use of com.apifest.oauth20.api.ICustomGrantTypeHandler in project xian by happyyangyuan.
the class Authenticator method callCustomGrantTypeHandler.
protected UserDetails callCustomGrantTypeHandler(HttpRequest authRequest) throws AuthenticationException {
UserDetails userDetails = null;
ICustomGrantTypeHandler customHandler;
if (OAuthConfig.getCustomGrantTypeHandler() != null) {
try {
customHandler = OAuthConfig.getCustomGrantTypeHandler().newInstance();
userDetails = customHandler.execute(authRequest);
} catch (InstantiationException | IllegalAccessException e) {
LOG.error("cannot instantiate custom grant_type class", e);
throw new AuthenticationException(e.getMessage());
}
}
return userDetails;
}
Aggregations