use of org.wso2.identity.integration.test.oidc.bean.OIDCApplication in project product-is by wso2.
the class OIDCAuthCodeGrantSSOTestCase method initApplications.
protected void initApplications() throws Exception {
OIDCApplication playgroundApp = new OIDCApplication(OIDCUtilTest.playgroundAppOneAppName, OIDCUtilTest.playgroundAppOneAppContext, OIDCUtilTest.playgroundAppOneAppCallBackUri);
playgroundApp.addRequiredClaim(OIDCUtilTest.emailClaimUri);
playgroundApp.addRequiredClaim(OIDCUtilTest.firstNameClaimUri);
playgroundApp.addRequiredClaim(OIDCUtilTest.lastNameClaimUri);
applications.put(OIDCUtilTest.playgroundAppOneAppName, playgroundApp);
playgroundApp = new OIDCApplication(OIDCUtilTest.playgroundAppTwoAppName, OIDCUtilTest.playgroundAppTwoAppContext, OIDCUtilTest.playgroundAppTwoAppCallBackUri);
playgroundApp.addRequiredClaim(OIDCUtilTest.emailClaimUri);
playgroundApp.addRequiredClaim(OIDCUtilTest.firstNameClaimUri);
playgroundApp.addRequiredClaim(OIDCUtilTest.lastNameClaimUri);
applications.put(OIDCUtilTest.playgroundAppTwoAppName, playgroundApp);
}
use of org.wso2.identity.integration.test.oidc.bean.OIDCApplication in project product-is by wso2.
the class OIDCFederatedIdpInitLogoutTest method updateServiceProviderWithOIDCConfigs.
private void updateServiceProviderWithOIDCConfigs(int portOffset, String applicationName, String callbackUrl, String backChannelLogoutUrl, ServiceProvider serviceProvider) throws Exception {
OIDCApplication application = new OIDCApplication(applicationName, OAuth2Constant.TRAVELOCITY_APP_CONTEXT_ROOT, callbackUrl);
OAuthConsumerAppDTO appDTO = getOAuthConsumerAppDTO(application);
appDTO.setBackChannelLogoutUrl(backChannelLogoutUrl);
OAuthConsumerAppDTO[] appDtos = createOIDCConfiguration(portOffset, appDTO);
for (OAuthConsumerAppDTO appDto : appDtos) {
if (appDto.getApplicationName().equals(application.getApplicationName())) {
application.setClientId(appDto.getOauthConsumerKey());
application.setClientSecret(appDto.getOauthConsumerSecret());
}
}
ClaimConfig claimConfig = null;
if (!application.getRequiredClaims().isEmpty()) {
claimConfig = new ClaimConfig();
for (String claimUri : application.getRequiredClaims()) {
Claim claim = new Claim();
claim.setClaimUri(claimUri);
ClaimMapping claimMapping = new ClaimMapping();
claimMapping.setRequested(true);
claimMapping.setLocalClaim(claim);
claimMapping.setRemoteClaim(claim);
claimConfig.addClaimMappings(claimMapping);
}
}
serviceProvider.setClaimConfig(claimConfig);
serviceProvider.setOutboundProvisioningConfig(new OutboundProvisioningConfig());
List<InboundAuthenticationRequestConfig> authRequestList = new ArrayList<>();
if (application.getClientId() != null) {
InboundAuthenticationRequestConfig inboundAuthenticationRequestConfig = new InboundAuthenticationRequestConfig();
inboundAuthenticationRequestConfig.setInboundAuthKey(application.getClientId());
secondaryISClientID = application.getClientId();
inboundAuthenticationRequestConfig.setInboundAuthType(OAuth2Constant.OAUTH_2);
if (StringUtils.isNotBlank(application.getClientSecret())) {
org.wso2.carbon.identity.application.common.model.xsd.Property property = new org.wso2.carbon.identity.application.common.model.xsd.Property();
property.setName(OAuth2Constant.OAUTH_CONSUMER_SECRET);
property.setValue(application.getClientSecret());
secondaryISClientSecret = application.getClientSecret();
org.wso2.carbon.identity.application.common.model.xsd.Property[] properties = { property };
inboundAuthenticationRequestConfig.setProperties(properties);
}
serviceProvider.getInboundAuthenticationConfig().setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { inboundAuthenticationRequestConfig });
authRequestList.add(inboundAuthenticationRequestConfig);
}
super.updateServiceProvider(PORT_OFFSET_1, serviceProvider);
}
use of org.wso2.identity.integration.test.oidc.bean.OIDCApplication in project product-is by wso2.
the class OIDCFederatedIdpInitLogoutTest method getOAuthConsumerAppDTO.
private OAuthConsumerAppDTO getOAuthConsumerAppDTO(OIDCApplication application) {
OAuthConsumerAppDTO appDTO = new OAuthConsumerAppDTO();
appDTO.setApplicationName(application.getApplicationName());
appDTO.setCallbackUrl(application.getCallBackURL());
appDTO.setOAuthVersion(OAuth2Constant.OAUTH_VERSION_2);
appDTO.setGrantTypes("authorization_code implicit password client_credentials refresh_token " + "urn:ietf:params:oauth:grant-type:saml2-bearer iwa:ntlm");
return appDTO;
}
use of org.wso2.identity.integration.test.oidc.bean.OIDCApplication in project product-is by wso2.
the class OIDCIdentityFederationTestCase method updateServiceProviderWithOIDCConfigs.
private void updateServiceProviderWithOIDCConfigs(int portOffset, String applicationName, String callbackUrl, ServiceProvider serviceProvider) throws Exception {
OIDCApplication application = new OIDCApplication(applicationName, OAuth2Constant.TRAVELOCITY_APP_CONTEXT_ROOT, callbackUrl);
OAuthConsumerAppDTO appDTO = getOAuthConsumerAppDTO(application);
OAuthConsumerAppDTO[] appDtos = createOIDCConfiguration(portOffset, appDTO);
for (OAuthConsumerAppDTO appDto : appDtos) {
if (appDto.getApplicationName().equals(application.getApplicationName())) {
application.setClientId(appDto.getOauthConsumerKey());
application.setClientSecret(appDto.getOauthConsumerSecret());
}
}
ClaimConfig claimConfig = null;
if (!application.getRequiredClaims().isEmpty()) {
claimConfig = new ClaimConfig();
for (String claimUri : application.getRequiredClaims()) {
Claim claim = new Claim();
claim.setClaimUri(claimUri);
ClaimMapping claimMapping = new ClaimMapping();
claimMapping.setRequested(true);
claimMapping.setLocalClaim(claim);
claimMapping.setRemoteClaim(claim);
claimConfig.addClaimMappings(claimMapping);
}
}
serviceProvider.setClaimConfig(claimConfig);
serviceProvider.setOutboundProvisioningConfig(new OutboundProvisioningConfig());
List<InboundAuthenticationRequestConfig> authRequestList = new ArrayList<>();
if (application.getClientId() != null) {
InboundAuthenticationRequestConfig inboundAuthenticationRequestConfig = new InboundAuthenticationRequestConfig();
inboundAuthenticationRequestConfig.setInboundAuthKey(application.getClientId());
secondaryISClientID = application.getClientId();
inboundAuthenticationRequestConfig.setInboundAuthType(OAuth2Constant.OAUTH_2);
if (StringUtils.isNotBlank(application.getClientSecret())) {
org.wso2.carbon.identity.application.common.model.xsd.Property property = new org.wso2.carbon.identity.application.common.model.xsd.Property();
property.setName(OAuth2Constant.OAUTH_CONSUMER_SECRET);
property.setValue(application.getClientSecret());
secondaryISClientSecret = application.getClientSecret();
org.wso2.carbon.identity.application.common.model.xsd.Property[] properties = { property };
inboundAuthenticationRequestConfig.setProperties(properties);
}
serviceProvider.getInboundAuthenticationConfig().setInboundAuthenticationRequestConfigs(new InboundAuthenticationRequestConfig[] { inboundAuthenticationRequestConfig });
authRequestList.add(inboundAuthenticationRequestConfig);
}
super.updateServiceProvider(PORT_OFFSET_1, serviceProvider);
}
use of org.wso2.identity.integration.test.oidc.bean.OIDCApplication in project product-is by wso2.
the class OIDCIdentityFederationTestCase method getOAuthConsumerAppDTO.
private OAuthConsumerAppDTO getOAuthConsumerAppDTO(OIDCApplication application) {
OAuthConsumerAppDTO appDTO = new OAuthConsumerAppDTO();
appDTO.setApplicationName(application.getApplicationName());
appDTO.setCallbackUrl(application.getCallBackURL());
appDTO.setOAuthVersion(OAuth2Constant.OAUTH_VERSION_2);
appDTO.setGrantTypes("authorization_code implicit password client_credentials refresh_token " + "urn:ietf:params:oauth:grant-type:saml2-bearer iwa:ntlm");
return appDTO;
}
Aggregations