use of io.gravitee.am.gateway.handler.oauth2.service.request.TokenRequestResolver in project gravitee-access-management by gravitee-io.
the class ExtensionGrantManagerImpl method updateExtensionGrantProvider.
private void updateExtensionGrantProvider(ExtensionGrant extensionGrant) {
try {
AuthenticationProvider authenticationProvider = null;
if (extensionGrant.getIdentityProvider() != null) {
logger.info("\tLooking for extension grant identity provider: {}", extensionGrant.getIdentityProvider());
authenticationProvider = identityProviderManager.get(extensionGrant.getIdentityProvider()).blockingGet();
if (authenticationProvider != null) {
logger.info("\tExtension grant identity provider: {}, loaded", extensionGrant.getIdentityProvider());
}
}
ExtensionGrantProvider extensionGrantProvider = extensionGrantPluginManager.create(extensionGrant.getType(), extensionGrant.getConfiguration(), authenticationProvider);
ExtensionGrantGranter extensionGrantGranter = new ExtensionGrantGranter(extensionGrantProvider, extensionGrant, userAuthenticationManager, tokenService, tokenRequestResolver, identityProviderManager, userService);
// backward compatibility, set min date to the extension grant granter to choose the good one for the old clients
extensionGrantGranter.setMinDate(minDate);
((CompositeTokenGranter) tokenGranter).addTokenGranter(extensionGrant.getId(), extensionGrantGranter);
extensionGrants.put(extensionGrant.getId(), extensionGrant);
extensionGrantGranters.put(extensionGrant.getId(), extensionGrantGranter);
} catch (Exception ex) {
// failed to load the plugin
logger.error("An error occurs while initializing the extension grant : {}", extensionGrant.getName(), ex);
removeExtensionGrant(extensionGrant.getId());
}
}
use of io.gravitee.am.gateway.handler.oauth2.service.request.TokenRequestResolver in project gravitee-access-management by gravitee-io.
the class CompositeTokenGranter method afterPropertiesSet.
@Override
public void afterPropertiesSet() {
this.tokenRequestResolver.setScopeManager(this.scopeManager);
addTokenGranter(GrantType.CLIENT_CREDENTIALS, new ClientCredentialsTokenGranter(tokenRequestResolver, tokenService));
addTokenGranter(GrantType.PASSWORD, new ResourceOwnerPasswordCredentialsTokenGranter(tokenRequestResolver, tokenService, userAuthenticationManager));
addTokenGranter(GrantType.AUTHORIZATION_CODE, new AuthorizationCodeTokenGranter(tokenRequestResolver, tokenService, authorizationCodeService, userAuthenticationManager, authenticationFlowContextService, environment));
addTokenGranter(GrantType.REFRESH_TOKEN, new RefreshTokenGranter(tokenRequestResolver, tokenService, userAuthenticationManager));
addTokenGranter(GrantType.UMA, new UMATokenGranter(tokenService, userAuthenticationManager, permissionTicketService, resourceService, jwtService, domain, rulesEngine, executionContextFactory));
addTokenGranter(GrantType.CIBA_GRANT_TYPE, new CibaTokenGranter(tokenRequestResolver, tokenService, userAuthenticationManager, authenticationRequestService, domain));
}
Aggregations