Skip to content

Commit 8c23ae2

Browse files
author
Chris Wiechmann
committed
Bugfix, when changing Desired-Scope name
1 parent 5e1bcaf commit 8c23ae2

2 files changed

Lines changed: 36 additions & 27 deletions

File tree

modules/apim-adapter/src/main/java/com/axway/apim/adapter/clientApps/APIMgrAppsAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,11 @@ private void getScopes2AddOrUpdate(ClientApplication actualApp, ClientApplicatio
643643
existingScopes = actualApp.getOauthResources();
644644
}
645645
if(existingScopes==null) existingScopes = new ArrayList<ClientAppOauthResource>();
646-
boolean existingScopeFound = false;
647646
if(desiredScopes!=null) {
648647
// Iterate over the given desired scopes
649648
Iterator<ClientAppOauthResource> it = desiredScopes.iterator();
650649
while(it.hasNext()) {
650+
boolean existingScopeFound = false;
651651
ClientAppOauthResource desiredScope = it.next();
652652
// Compare each desired scope, if it is already included in the existing scopes
653653
for(ClientAppOauthResource existingScope : existingScopes) {
Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
{
2-
"name" : "${appName}",
3-
"organization" : "${orgName}",
4-
"description" : "${description}",
5-
"state" : "${state}",
6-
"image" : "${appImage}",
7-
"enabled" : true,
8-
"email" : "${email}",
9-
"phone" : "${phone}",
10-
"credentials" : [ {
11-
"credentialType" : "oauth",
12-
"enabled" : true,
13-
"secret" : "9cb76d80-1bc2-48d3-8d31-edeec0fddf6c",
14-
"corsOrigins" : [ ],
15-
"cert" : "app-oauth-cert.crt",
16-
"type" : "confidential",
17-
"clientId" : "ClientConfidentialApp-${appNumber}",
18-
"redirectUrls" : [ "https://localhost:8088/client/apigateway/callback", "https://oauthclient:8088/client/apigateway/callback" ]
19-
}],
20-
"oauthResources" : [{
21-
"scope": "${scope1}",
22-
"isDefault": ${isDefault1}
23-
},
24-
{
25-
"scope": "${scope2}",
26-
"isDefault": ${isDefault2} }
27-
]
2+
"name": "${appName}",
3+
"organization": "${orgName}",
4+
"description": "${description}",
5+
"state": "${state}",
6+
"image": "${appImage}",
7+
"enabled": true,
8+
"email": "${email}",
9+
"phone": "${phone}",
10+
"credentials": [
11+
{
12+
"credentialType": "oauth",
13+
"enabled": true,
14+
"secret": "9cb76d80-1bc2-48d3-8d31-edeec0fddf6c",
15+
"corsOrigins": [
16+
17+
],
18+
"cert": "app-oauth-cert.crt",
19+
"type": "confidential",
20+
"clientId": "ClientConfidentialApp-${appNumber}",
21+
"redirectUrls": [
22+
"https://localhost:8088/client/apigateway/callback",
23+
"https://oauthclient:8088/client/apigateway/callback"
24+
]
25+
}
26+
],
27+
"appScopes": [
28+
{
29+
"scope": "${scope1}",
30+
"isDefault": ${isDefault1}
31+
},
32+
{
33+
"scope": "${scope2}",
34+
"isDefault": ${isDefault2}
35+
}
36+
]
2837
}

0 commit comments

Comments
 (0)