use of org.neo4j.server.security.enterprise.auth.plugin.api.AuthToken in project neo4j by neo4j.
the class PluginRealm method doGetAuthenticationInfo.
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
if (token instanceof ShiroAuthToken) {
try {
AuthToken pluginAuthToken = PluginApiAuthToken.createFromMap(((ShiroAuthToken) token).getAuthTokenMap());
if (authPlugin != null) {
AuthInfo authInfo = authPlugin.authenticateAndAuthorize(pluginAuthToken);
if (authInfo != null) {
PluginAuthInfo pluginAuthInfo = PluginAuthInfo.createCacheable(authInfo, getName(), secureHasher);
cacheAuthorizationInfo(pluginAuthInfo);
return pluginAuthInfo;
}
} else if (authenticationPlugin != null) {
org.neo4j.server.security.enterprise.auth.plugin.spi.AuthenticationInfo authenticationInfo = authenticationPlugin.authenticate(pluginAuthToken);
if (authenticationInfo != null) {
return PluginAuthenticationInfo.createCacheable(authenticationInfo, getName(), secureHasher);
}
}
} catch (org.neo4j.server.security.enterprise.auth.plugin.api.AuthenticationException | InvalidAuthTokenException e) {
throw new AuthenticationException(e.getMessage(), e.getCause());
}
}
return null;
}
Aggregations