use of org.wso2.carbon.identity.entitlement.endpoint.auth.EntitlementAuthConfigReader in project carbon-identity-framework by wso2.
the class ApplicationInitializer method initEntitlementAuthenticatorRegistry.
private void initEntitlementAuthenticatorRegistry() {
EntitlementAuthenticatorRegistry entitlementAuthRegistry = EntitlementAuthenticatorRegistry.getInstance();
if (entitlementAuthRegistry != null) {
// set authenticators after building auth config
EntitlementAuthConfigReader configReader = new EntitlementAuthConfigReader();
List<EntitlementAuthenticationHandler> entitlementAuthenticators = configReader.buildEntitlementAuthenticators();
if (entitlementAuthenticators != null && !entitlementAuthenticators.isEmpty()) {
for (EntitlementAuthenticationHandler entitlementAuthenticator : entitlementAuthenticators) {
entitlementAuthRegistry.setAuthenticator(entitlementAuthenticator);
}
} else {
// initialize default basic auth authenticator & OAuth authenticator and set it in the auth registry.
BasicAuthHandler basicAuthHandler = new BasicAuthHandler();
basicAuthHandler.setDefaultPriority();
entitlementAuthRegistry.setAuthenticator(basicAuthHandler);
}
}
}
Aggregations