Skip to content

Commit 433c106

Browse files
authored
Fix OAuth2 issues: Restore 'none' token endpoint auth method. Do not add default openid scope if non-empty. (#926)
1 parent 74bb012 commit 433c106

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

openam-oauth2/src/main/java/org/forgerock/openidconnect/Client.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
* Copyright 2014-2016 ForgeRock AS.
1515
* Portions Copyrighted 2015 Nomura Research Institute, Ltd.
16+
* Portions Copyrighted 2025 3A Systems LLC.
1617
*/
1718

1819
package org.forgerock.openidconnect;
@@ -217,9 +218,9 @@ public enum TokenEndpointAuthMethod {
217218
/** Client secret post type. */
218219
// CLIENT_SECRET_JWT("client_secret_jwt"), todo uncomment as we add suppot
219220
/** Client secret basic type. */
220-
PRIVATE_KEY_JWT("private_key_jwt");
221+
PRIVATE_KEY_JWT("private_key_jwt"),
221222
/** None type. */
222-
// NONE("none");
223+
NONE("none");
223224

224225
private String type;
225226

openam-oauth2/src/main/java/org/forgerock/openidconnect/OpenIdConnectClientRegistrationService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,13 @@ public JsonValue createRegistration(String accessToken, String deploymentUrl, OA
271271
throw new InvalidClientMetadata("Invalid scopes requested");
272272
}
273273
} else { //if nothing requested, fall back to provider defaults
274-
scopes = new ArrayList<String>();
274+
scopes = new ArrayList<>();
275275
scopes.addAll(providerSettings.getDefaultScopes());
276276
}
277277

278278
//regardless, we add openid
279-
if (!scopes.contains(OPENID)) {
280-
scopes = new ArrayList<String>(scopes);
279+
if (scopes.isEmpty()) {
280+
scopes = new ArrayList<>();
281281
scopes.add(OPENID);
282282
}
283283

openam-server-only/src/main/resources/services/AgentService.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
2929
Portions Copyrighted 2011-2016 ForgeRock AS.
3030
Portions Copyrighted 2015 Nomura Research Institute, Ltd.
31+
Portions Copyrighted 2025 3A Systems LLC.
3132
-->
3233

3334
<!DOCTYPE ServicesConfiguration
@@ -36,7 +37,7 @@
3637

3738
<ServicesConfiguration>
3839
<Service name="AgentService" version="1.0">
39-
<Schema i18nFileName="agentService" revisionNumber="10">
40+
<Schema i18nFileName="agentService" revisionNumber="11">
4041
<Organization>
4142
<SubSchema name="OAuth2Client" inheritance="multiple" i18nKey="a7001" hideConfigUI="yes">
4243
<AttributeSchema
@@ -181,6 +182,7 @@
181182
<ChoiceValue i18nKey="a741">client_secret_basic</ChoiceValue>
182183
<!-- <ChoiceValue i18nKey="a742">client_secret_jwt</ChoiceValue> -->
183184
<ChoiceValue i18nKey="a743">private_key_jwt</ChoiceValue>
185+
<ChoiceValue>none</ChoiceValue>
184186
</ChoiceValues>
185187
<DefaultValues>
186188
<Value>client_secret_basic</Value>

0 commit comments

Comments
 (0)