use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.
the class DefaultAuthSeqManagementTestCase method getDefaultAuthSeq.
private DefaultAuthenticationSequence getDefaultAuthSeq(String seqName, String seqDesc, String seqContentXml, LocalAndOutboundAuthenticationConfig seqContent) {
DefaultAuthenticationSequence sequence = new DefaultAuthenticationSequence();
sequence.setName(seqName);
sequence.setDescription(seqDesc);
sequence.setContentXml(seqContentXml);
sequence.setContent(seqContent);
return sequence;
}
use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.
the class AbstractAdaptiveAuthenticationTestCase method createServiceProvider.
protected ServiceProvider createServiceProvider(String appName, ApplicationManagementServiceClient applicationManagementServiceClient, OauthAdminClient oauthAdminClient, String script) throws Exception {
OAuthConsumerAppDTO[] appDtos = oauthAdminClient.getAllOAuthApplicationData();
for (OAuthConsumerAppDTO appDto : appDtos) {
if (appDto.getApplicationName().equals(appName)) {
consumerKey = appDto.getOauthConsumerKey();
consumerSecret = appDto.getOauthConsumerSecret();
}
}
ServiceProvider serviceProvider = new ServiceProvider();
serviceProvider.setApplicationName(appName);
serviceProvider.setDescription("This is a test Service Provider for conditional authentication flow test.");
applicationManagementServiceClient.createApplication(serviceProvider);
serviceProvider = applicationManagementServiceClient.getApplication(appName);
InboundAuthenticationRequestConfig requestConfig = new InboundAuthenticationRequestConfig();
requestConfig.setInboundAuthKey(consumerKey);
requestConfig.setInboundAuthType("oauth2");
if (StringUtils.isNotBlank(consumerSecret)) {
Property property = new Property();
property.setName("oauthConsumerSecret");
property.setValue(consumerSecret);
Property[] properties = { property };
requestConfig.setProperties(properties);
}
InboundAuthenticationConfig inboundAuthenticationConfig = new InboundAuthenticationConfig();
inboundAuthenticationConfig.setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { requestConfig });
serviceProvider.setInboundAuthenticationConfig(inboundAuthenticationConfig);
LocalAndOutboundAuthenticationConfig outboundAuthConfig = createLocalAndOutboundAuthenticationConfig();
outboundAuthConfig.setEnableAuthorization(false);
AuthenticationScriptConfig config = new AuthenticationScriptConfig();
config.setContent(script);
config.setEnabled(true);
outboundAuthConfig.setAuthenticationScriptConfig(config);
serviceProvider.setLocalAndOutBoundAuthenticationConfig(outboundAuthConfig);
applicationManagementServiceClient.updateApplicationData(serviceProvider);
return serviceProvider;
}
use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.
the class AbstractAdaptiveAuthenticationTestCase method createLocalAndOutboundAuthenticationConfig.
/**
* Create the AdvancedAuthenticator with Multi steps.
* Use any attributes needed if needed to do multiple tests with different advanced authenticators.
*
* @throws Exception
*/
protected LocalAndOutboundAuthenticationConfig createLocalAndOutboundAuthenticationConfig() throws Exception {
LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = new LocalAndOutboundAuthenticationConfig();
localAndOutboundAuthenticationConfig.setAuthenticationType("flow");
AuthenticationStep authenticationStep1 = new AuthenticationStep();
authenticationStep1.setStepOrder(1);
LocalAuthenticatorConfig localConfig = new LocalAuthenticatorConfig();
localConfig.setName(CommonConstants.BASIC_AUTHENTICATOR);
localConfig.setDisplayName("basicauth");
localConfig.setEnabled(true);
authenticationStep1.setLocalAuthenticatorConfigs(new LocalAuthenticatorConfig[] { localConfig });
authenticationStep1.setSubjectStep(true);
authenticationStep1.setAttributeStep(true);
localAndOutboundAuthenticationConfig.addAuthenticationSteps(authenticationStep1);
return localAndOutboundAuthenticationConfig;
}
use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.
the class RiskBasedLoginTestCase method createLocalAndOutboundAuthenticationConfig.
protected LocalAndOutboundAuthenticationConfig createLocalAndOutboundAuthenticationConfig() throws Exception {
LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = super.createLocalAndOutboundAuthenticationConfig();
AuthenticationStep authenticationStep2 = new AuthenticationStep();
authenticationStep2.setStepOrder(2);
LocalAuthenticatorConfig localConfig = new LocalAuthenticatorConfig();
localConfig.setName("DemoFingerprintAuthenticator");
localConfig.setDisplayName("Demo Fingerprint Authenticator");
localConfig.setEnabled(true);
authenticationStep2.setLocalAuthenticatorConfigs(new LocalAuthenticatorConfig[] { localConfig });
authenticationStep2.setSubjectStep(false);
authenticationStep2.setAttributeStep(false);
localAndOutboundAuthenticationConfig.addAuthenticationSteps(authenticationStep2);
return localAndOutboundAuthenticationConfig;
}
use of org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig in project product-is by wso2.
the class EmailOTPTestCase method getLocalAndOutBoundAuthenticator.
private LocalAndOutboundAuthenticationConfig getLocalAndOutBoundAuthenticator() throws Exception {
LocalAndOutboundAuthenticationConfig localAndOutboundAuthenticationConfig = new LocalAndOutboundAuthenticationConfig();
// This will add basic authentication as the first step for authentication.
AuthenticationStep authenticationStepOne = new AuthenticationStep();
authenticationStepOne.setStepOrder(1);
LocalAuthenticatorConfig localConfig = new LocalAuthenticatorConfig();
localConfig.setName(CommonConstants.BASIC_AUTHENTICATOR);
localConfig.setDisplayName("basicauth");
localConfig.setEnabled(true);
authenticationStepOne.setLocalAuthenticatorConfigs(new LocalAuthenticatorConfig[] { localConfig });
localAndOutboundAuthenticationConfig.addAuthenticationSteps(authenticationStepOne);
// This will add email otp as the second step for authentication.
AuthenticationStep authenticationStepTwo = new AuthenticationStep();
authenticationStepTwo.setStepOrder(2);
authenticationStepTwo.setSubjectStep(false);
authenticationStepTwo.setAttributeStep(false);
authenticationStepTwo.setFederatedIdentityProviders(new IdentityProvider[] { getEmailOTPIdP() });
localAndOutboundAuthenticationConfig.addAuthenticationSteps(authenticationStepTwo);
return localAndOutboundAuthenticationConfig;
}
Aggregations