Skip to content

Commit c0d9242

Browse files
committed
Improve kc-idp-hint extension, add client id value.
1 parent ee323a1 commit c0d9242

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cwms-data-api/src/main/java/cwms/cda/security/OpenIDConfig.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.IOException;
44
import java.net.HttpURLConnection;
55
import java.net.URL;
6+
import java.util.ArrayList;
67
import java.util.HashMap;
78
import java.util.Map;
89

@@ -64,13 +65,16 @@ public SecurityScheme getScheme() {
6465
if (idp_hint != null)
6566
{
6667
Map<String, Object> hint = new HashMap<>();
67-
hint.put("type", "object");
68-
Map<String, Object> properties = new HashMap<>();
69-
properties.put("kc_idp_hint", idp_hint);
70-
hint.put("properties", properties);
71-
68+
hint.put("query-parameter", "kc_idp_hint");
69+
ArrayList<String> values = new ArrayList<>();
70+
for (String value: idp_hint.split(",")) {
71+
values.add(value.trim());
72+
}
73+
hint.put("values", values);
7274
scheme.addExtension("x-kc_idp_hint", hint);
7375
}
76+
77+
scheme.addExtension("x-oidc-client-id", client_id);
7478
return scheme;
7579
}
7680
}

0 commit comments

Comments
 (0)