[java-oidc-common] branch main updated: Add token type property.

Scott Cantor cantor.2 at osu.edu
Mon Jan 10 22:15:50 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=d7d2b7ceba04b957d094c21006c525d4c6919de5

The following commit(s) were added to refs/heads/main by this push:
     new d7d2b7c  Add token type property.
d7d2b7c is described below

commit d7d2b7ceba04b957d094c21006c525d4c6919de5
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jan 10 17:15:47 2022 -0500

    Add token type property.
---
 .../config/AbstractOIDCSSOConfiguration.java       | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/AbstractOIDCSSOConfiguration.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/AbstractOIDCSSOConfiguration.java
index 0c4ca13..d57f61f 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/AbstractOIDCSSOConfiguration.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/config/AbstractOIDCSSOConfiguration.java
@@ -69,6 +69,9 @@ public abstract class AbstractOIDCSSOConfiguration extends AbstractOAuth2FlowAwa
     /** Lookup function to supply access token lifetime. */
     @Nonnull private Function<ProfileRequestContext,Duration> accessTokenLifetimeLookupStrategy;
 
+    /** Lookup functioon to supply access token type. */
+    @Nonnull private Function<ProfileRequestContext,String> accessTokenTypeLookupStrategy;
+    
     /** Lookup function to supply refresh token lifetime. */
     @Nonnull private Function<ProfileRequestContext,Duration> refreshTokenLifetimeLookupStrategy;
     
@@ -91,6 +94,8 @@ public abstract class AbstractOIDCSSOConfiguration extends AbstractOAuth2FlowAwa
         forcePKCEPredicate = Predicates.alwaysFalse();
         allowPKCEPlainPredicate = Predicates.alwaysFalse();
         
+        accessTokenTypeLookupStrategy = FunctionSupport.constant(null);
+        
         idTokenLifetimeLookupStrategy = FunctionSupport.constant(Duration.ofHours(1));
         accessTokenLifetimeLookupStrategy = FunctionSupport.constant(Duration.ofMinutes(10));
         refreshTokenLifetimeLookupStrategy = FunctionSupport.constant(Duration.ofHours(2));
@@ -210,7 +215,36 @@ public abstract class AbstractOIDCSSOConfiguration extends AbstractOAuth2FlowAwa
     */
    public void setAllowPKCEPlainPredicate(@Nonnull final Predicate<ProfileRequestContext> condition) {
        allowPKCEPlainPredicate = Constraint.isNotNull(condition, "Condition cannot be null");
-   }    
+   }
+   
+   /**
+    * Get access token type.
+    * 
+    * @param profileRequestContext profile request context
+    * 
+    * @return access token type, or null for unspecified/opaque
+    */
+   @Nullable @NotEmpty public String getAccessTokenType(@Nullable final ProfileRequestContext profileRequestContext) {
+       return accessTokenTypeLookupStrategy.apply(profileRequestContext);
+   }
+   
+   /**
+    * Set access token type.
+    * 
+    * @param type token type, or null for unspecified/opaque
+    */
+   public void setAccessTokenType(@Nullable @NotEmpty final String type) {
+       accessTokenTypeLookupStrategy = FunctionSupport.constant(StringSupport.trimOrNull(type));
+   }
+   
+   /**
+    * Set lookup strategy for access token type.
+    * 
+    * @param strategy lookup strategy
+    */
+   public void setAccessTokenTypeLookupStrategy(@Nonnull final Function<ProfileRequestContext,String> strategy) {
+       accessTokenTypeLookupStrategy = Constraint.isNotNull(strategy, "Lookup strategy cannot be null");
+   }
 
    /**
     

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


More information about the commits mailing list