From 34ace12266019a2dfa8a5ddff378a0dc6e9a7b83 Mon Sep 17 00:00:00 2001 From: Kannan Kirishikesan Date: Thu, 17 Aug 2023 21:45:38 +0530 Subject: [PATCH] Changes grants from String to ArrayList --- .../src/main/resources/web/oauth/edit.jsp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/org.wso2.carbon.identity.oauth.ui/src/main/resources/web/oauth/edit.jsp b/components/org.wso2.carbon.identity.oauth.ui/src/main/resources/web/oauth/edit.jsp index fe60617f4f6..7f32d11c3d6 100755 --- a/components/org.wso2.carbon.identity.oauth.ui/src/main/resources/web/oauth/edit.jsp +++ b/components/org.wso2.carbon.identity.oauth.ui/src/main/resources/web/oauth/edit.jsp @@ -63,7 +63,7 @@ String applicationSPName = null; OAuthAdminClient client = null; String action = null; - String grants = null; + List grants = null; String[] audiences = null; String audienceTableStyle = "display:none"; List allowedScopeValidators = new ArrayList(); @@ -171,12 +171,15 @@ } // setting grants if oauth version 2.0 if (OAuthConstants.OAuthVersions.VERSION_2.equals(app.getOAuthVersion())) { - grants = app.getGrantTypes(); + String appGrantTypes = app.getGrantTypes(); + if (appGrantTypes != null) { + grants = new ArrayList(Arrays.asList(appGrantTypes.split(" "))); + } if (grants != null) { codeGrant = grants.contains("authorization_code"); implicitGrant = grants.contains("implicit"); } else { - grants = ""; + grants = new ArrayList(); } audiences = app.getAudiences(); String[] val = app.getScopeValidators(); @@ -184,7 +187,7 @@ scopeValidators = Arrays.asList(val); } } else { - grants = ""; + grants = new ArrayList(); } }