use of org.wso2.carbon.identity.entitlement.endpoint.auth.BasicAuthHandler 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);
}
}
}
use of org.wso2.carbon.identity.entitlement.endpoint.auth.BasicAuthHandler in project product-is by wso2.
the class ProvisioningTestCase method getBasicAuthInfo.
private BasicAuthInfo getBasicAuthInfo(AutomationContext context) throws XPathExpressionException {
BasicAuthInfo basicAuthInfo = new BasicAuthInfo();
basicAuthInfo.setUserName(context.getSuperTenant().getTenantAdmin().getUserName());
basicAuthInfo.setPassword(context.getSuperTenant().getTenantAdmin().getPassword());
BasicAuthHandler basicAuthHandler = new BasicAuthHandler();
return (BasicAuthInfo) basicAuthHandler.getAuthenticationToken(basicAuthInfo);
}
use of org.wso2.carbon.identity.entitlement.endpoint.auth.BasicAuthHandler in project product-is by wso2.
the class SCIMUtils method getBasicAuthInfo.
/**
* Construct and return basic authentication information of the given user.
*
* @param userInfo user representation
* @return BasicAuthInfo instance containing user authentication information
*/
public static BasicAuthInfo getBasicAuthInfo(org.wso2.carbon.automation.engine.context.beans.User userInfo) {
BasicAuthInfo basicAuthInfo = new BasicAuthInfo();
basicAuthInfo.setUserName(userInfo.getUserName());
basicAuthInfo.setPassword(userInfo.getPassword());
BasicAuthHandler basicAuthHandler = new BasicAuthHandler();
return (BasicAuthInfo) basicAuthHandler.getAuthenticationToken(basicAuthInfo);
}
use of org.wso2.carbon.identity.entitlement.endpoint.auth.BasicAuthHandler in project product-is by wso2.
the class Utils method getBasicAuthHeader.
/**
* Construct and return basic authentication information of the user.
*/
public static String getBasicAuthHeader(User userInfo) {
BasicAuthInfo basicAuthInfo = new BasicAuthInfo();
basicAuthInfo.setUserName(userInfo.getUserName());
basicAuthInfo.setPassword(userInfo.getPassword());
BasicAuthHandler basicAuthHandler = new BasicAuthHandler();
BasicAuthInfo encodedBasicAuthInfo = (BasicAuthInfo) basicAuthHandler.getAuthenticationToken(basicAuthInfo);
return encodedBasicAuthInfo.getAuthorizationHeader();
}
use of org.wso2.carbon.identity.entitlement.endpoint.auth.BasicAuthHandler in project product-is by wso2.
the class MasterSCIMInitiator method getBasicAuthInfo.
protected BasicAuthInfo getBasicAuthInfo(org.wso2.carbon.automation.engine.context.beans.User provider_userInfo) {
BasicAuthInfo basicAuthInfo = new BasicAuthInfo();
basicAuthInfo.setUserName(provider_userInfo.getUserName());
basicAuthInfo.setPassword(provider_userInfo.getPassword());
BasicAuthHandler basicAuthHandler = new BasicAuthHandler();
return (BasicAuthInfo) basicAuthHandler.getAuthenticationToken(basicAuthInfo);
}
Aggregations