[java-oidc-common] branch main updated: Adjust default grant type handling for compatibility.

Scott Cantor cantor.2 at osu.edu
Mon Feb 14 17:19:21 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-oidc-common.

View the commit online:
http://git.shibboleth.net/view/?p=java-oidc-common.git;a=commit;h=0a8d7eb3c8edb221169c10ef81e9c97b86b7540e

The following commit(s) were added to refs/heads/main by this push:
     new 0a8d7eb  Adjust default grant type handling for compatibility.
0a8d7eb is described below

commit 0a8d7eb3c8edb221169c10ef81e9c97b86b7540e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Feb 14 12:19:18 2022 -0500

    Adjust default grant type handling for compatibility.
---
 .../net/shibboleth/oidc/profile/config/OIDCTokenConfiguration.java    | 4 ++--
 .../oidc/profile/config/navigate/GrantTypesLookupFunction.java        | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/OIDCTokenConfiguration.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/OIDCTokenConfiguration.java
index 829a306..db45e82 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/OIDCTokenConfiguration.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/OIDCTokenConfiguration.java
@@ -54,7 +54,8 @@ public class OIDCTokenConfiguration extends AbstractOIDCSSOConfiguration {
     public OIDCTokenConfiguration() {
         this(PROFILE_ID);
         
-        grantTypesLookupStrategy = FunctionSupport.constant(Set.of(GrantType.AUTHORIZATION_CODE.toString()));
+        grantTypesLookupStrategy = FunctionSupport.constant(
+                Set.of(GrantType.AUTHORIZATION_CODE.toString(), GrantType.REFRESH_TOKEN.toString()));
     }
 
     /**
@@ -66,7 +67,6 @@ public class OIDCTokenConfiguration extends AbstractOIDCSSOConfiguration {
         super(profileId);
     }
 
-
     /**
      * Get the enabled grant types.
      * 
diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/GrantTypesLookupFunction.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/GrantTypesLookupFunction.java
index 786633d..39dbb8f 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/GrantTypesLookupFunction.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/navigate/GrantTypesLookupFunction.java
@@ -29,6 +29,7 @@ import com.nimbusds.oauth2.sdk.GrantType;
 import net.shibboleth.idp.profile.config.ProfileConfiguration;
 import net.shibboleth.idp.profile.context.RelyingPartyContext;
 import net.shibboleth.idp.profile.context.navigate.AbstractRelyingPartyLookupFunction;
+import net.shibboleth.oidc.profile.config.OIDCAuthorizationConfiguration;
 import net.shibboleth.oidc.profile.config.OIDCTokenConfiguration;
 
 /**
@@ -54,6 +55,9 @@ public class GrantTypesLookupFunction extends AbstractRelyingPartyLookupFunction
                             .map(GrantType::new)
                             .collect(Collectors.toUnmodifiableSet());
                 }
+            } else if (pc instanceof OIDCAuthorizationConfiguration) {
+                // For compatibility just return the lone supported type.
+                return Set.of(GrantType.AUTHORIZATION_CODE, GrantType.REFRESH_TOKEN);
             }
         }
         

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list