|
27 | 27 | import org.wso2.carbon.apimgt.api.model.OAuthApplicationInfo;
|
28 | 28 | import org.wso2.carbon.apimgt.impl.APIConstants;
|
29 | 29 | import org.wso2.carbon.apimgt.rest.api.common.RestApiCommonUtil;
|
| 30 | +import org.wso2.carbon.apimgt.rest.api.common.RestApiConstants; |
| 31 | +import org.wso2.carbon.apimgt.rest.api.common.dto.ErrorDTO; |
30 | 32 | import org.wso2.carbon.apimgt.rest.api.dcr.web.RegistrationService;
|
31 | 33 | import org.wso2.carbon.apimgt.rest.api.dcr.web.dto.FaultResponse;
|
32 | 34 | import org.wso2.carbon.apimgt.rest.api.dcr.web.dto.RegistrationProfile;
|
33 |
| -import org.wso2.carbon.apimgt.rest.api.common.RestApiConstants; |
34 |
| -import org.wso2.carbon.apimgt.rest.api.common.dto.ErrorDTO; |
35 | 35 | import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil;
|
36 | 36 | import org.wso2.carbon.context.PrivilegedCarbonContext;
|
37 | 37 | import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException;
|
38 | 38 | import org.wso2.carbon.identity.application.common.model.InboundAuthenticationConfig;
|
39 | 39 | import org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig;
|
| 40 | +import org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig; |
40 | 41 | import org.wso2.carbon.identity.application.common.model.Property;
|
41 | 42 | import org.wso2.carbon.identity.application.common.model.ServiceProvider;
|
42 | 43 | import org.wso2.carbon.identity.application.common.model.ServiceProviderProperty;
|
|
54 | 55 | import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
|
55 | 56 | import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
56 | 57 |
|
57 |
| -import java.util.ArrayList; |
58 |
| -import java.util.List; |
59 |
| -import java.util.HashMap; |
60 |
| -import java.util.Iterator; |
61 |
| -import java.util.Map; |
62 | 58 | import javax.ws.rs.Consumes;
|
63 | 59 | import javax.ws.rs.DELETE;
|
64 | 60 | import javax.ws.rs.POST;
|
|
68 | 64 | import javax.ws.rs.core.Context;
|
69 | 65 | import javax.ws.rs.core.MediaType;
|
70 | 66 | import javax.ws.rs.core.Response;
|
| 67 | +import java.util.ArrayList; |
| 68 | +import java.util.HashMap; |
| 69 | +import java.util.Iterator; |
| 70 | +import java.util.List; |
| 71 | +import java.util.Map; |
71 | 72 |
|
72 | 73 | import static org.wso2.carbon.apimgt.api.model.ApplicationConstants.OAUTH_CLIENT_GRANT;
|
73 | 74 | import static org.wso2.carbon.apimgt.api.model.ApplicationConstants.OAUTH_CLIENT_NAME;
|
@@ -275,10 +276,10 @@ private OAuthApplicationInfo getExistingApp(String applicationName, boolean saas
|
275 | 276 | *
|
276 | 277 | * @param appRequest OAuthAppRequest object with client's payload content
|
277 | 278 | * @return created Application
|
278 |
| - * @throws APIKeyMgtException if failed to create the a new application |
| 279 | + * @throws APIManagementException if failed to create the new application |
279 | 280 | */
|
280 | 281 | private OAuthApplicationInfo createApplication(String applicationName, OAuthAppRequest appRequest,
|
281 |
| - String grantType) throws APIManagementException { |
| 282 | + String grantType) throws APIManagementException { |
282 | 283 | String userName;
|
283 | 284 | OAuthApplicationInfo applicationInfo = appRequest.getOAuthApplicationInfo();
|
284 | 285 | String appName = applicationInfo.getClientName();
|
@@ -325,6 +326,14 @@ private OAuthApplicationInfo createApplication(String applicationName, OAuthAppR
|
325 | 326 | logoutConsentProperty.setValue(APIConstants.APP_SKIP_LOGOUT_CONSENT_VALUE);
|
326 | 327 | serviceProviderProperties.add(logoutConsentProperty);
|
327 | 328 |
|
| 329 | + if (APIConstants.JWT.equals(applicationInfo.getTokenType())) { |
| 330 | + LocalAndOutboundAuthenticationConfig localAndOutboundConfig = |
| 331 | + new LocalAndOutboundAuthenticationConfig(); |
| 332 | + localAndOutboundConfig.setSkipConsent(true); |
| 333 | + localAndOutboundConfig.setSkipLogoutConsent(true); |
| 334 | + localAndOutboundConfig.setUseTenantDomainInLocalSubjectIdentifier(true); |
| 335 | + serviceProvider.setLocalAndOutBoundAuthenticationConfig(localAndOutboundConfig); |
| 336 | + } |
328 | 337 | String orgId = null;
|
329 | 338 | try {
|
330 | 339 | orgId = RestApiUtil.getValidatedOrganization(securityContext);
|
|
0 commit comments