diff --git a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/RegistrationProfile.java b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/RegistrationProfile.java index fad85d0f79d..8014bde2f54 100644 --- a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/RegistrationProfile.java +++ b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/RegistrationProfile.java @@ -33,6 +33,8 @@ public class RegistrationProfile { private String[] contacts; private String[] requestUris; private String owner; + private String callbackUrl; + private String tokenScope; public String getApplicationType() { return applicationType; @@ -138,4 +140,20 @@ public class RegistrationProfile { this.owner = owner; } + public String getCallbackUrl() { + return callbackUrl; + } + + public void setCallbackUrl(String callbackUrl) { + this.callbackUrl = callbackUrl; + } + + public String getTokenScope() { + return tokenScope; + } + + public void setTokenScope(String tokenScope) { + this.tokenScope = tokenScope; + } + } diff --git a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/ClientRegistrationServiceImpl.java b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/ClientRegistrationServiceImpl.java index a6791c7f970..23b8aac24cc 100644 --- a/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/ClientRegistrationServiceImpl.java +++ b/components/oauth-extensions/dynamic-client-manager/src/main/java/org/wso2/carbon/identity/oauth/extension/impl/ClientRegistrationServiceImpl.java @@ -87,15 +87,9 @@ public class ClientRegistrationServiceImpl implements RegistrationService { log.debug("Trying to create OAuth application: '" + applicationName + "'"); } - String callBackURL = null; - if (oAuthApplicationInfo.getParameter("callback_url") != null) { - JSONArray jsonArray = (JSONArray) oAuthApplicationInfo.getParameter("callback_url"); - for (Object callbackUrlObject : jsonArray) { - callBackURL = (String) callbackUrlObject; - } - } + String callBackURL = profile.getCallbackUrl(); - String tokenScope = (String) oAuthApplicationInfo.getParameter("tokenScope"); + String tokenScope = profile.getTokenScope(); String tokenScopes[] = new String[1]; tokenScopes[0] = tokenScope;