[java-oidc-common] branch main updated: Fix authentication request parameter hierarchy

Phil Smart philip.smart at jisc.ac.uk
Tue Mar 14 17:05:11 UTC 2023


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

philsmart 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=e7bc9346ad34e1d11ba99caebd39f41d21a8f024

The following commit(s) were added to refs/heads/main by this push:
     new e7bc934  Fix authentication request parameter hierarchy
e7bc934 is described below

commit e7bc9346ad34e1d11ba99caebd39f41d21a8f024
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Mar 14 17:05:08 2023 +0000

    Fix authentication request parameter hierarchy
---
 .../profile/core/OAuthAuthorizationRequest.java    | 134 +--------------------
 .../profile/core/OIDCAuthenticationRequest.java    | 134 ++++++++++++++++++++-
 2 files changed, 131 insertions(+), 137 deletions(-)

diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OAuthAuthorizationRequest.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OAuthAuthorizationRequest.java
index 8389835..f4028b2 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OAuthAuthorizationRequest.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OAuthAuthorizationRequest.java
@@ -18,9 +18,6 @@
 package net.shibboleth.oidc.profile.core;
 
 import java.net.URI;
-import java.time.Duration;
-import java.util.Collections;
-import java.util.List;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -30,13 +27,7 @@ import com.nimbusds.oauth2.sdk.ResponseType;
 import com.nimbusds.oauth2.sdk.Scope;
 import com.nimbusds.oauth2.sdk.id.ClientID;
 import com.nimbusds.oauth2.sdk.id.State;
-import com.nimbusds.openid.connect.sdk.Display;
-import com.nimbusds.openid.connect.sdk.Nonce;
-import com.nimbusds.openid.connect.sdk.Prompt;
-import com.nimbusds.openid.connect.sdk.claims.ACR;
 
-import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
-import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 
 /**
@@ -60,37 +51,9 @@ public class OAuthAuthorizationRequest {
     /** The request endpoint. */
     @Nullable private URI endpointURI;
     
-    /** The nonce. */
-    @Nullable private Nonce nonce;
-    
     /** The requested scopes.*/
     @Nonnull private final Scope scope;
-    
-    /**
-     * ASCII string value that specifies how the Authorization Server 
-     * displays the authentication and consent user interface pages to the End-User.
-     */
-    @Nullable private Display display;
-    
-    /**
-     * Space delimited, case sensitive list of ASCII string values that 
-     * specifies whether the Authorization Server prompts the End-User 
-     * for reauthentication and consent.
-     */
-    @Nullable private Prompt prompt;
-    
-    /** 
-     * Specifies the allowable elapsed time in seconds since the last time 
-     * the End-User was actively authenticated by the OP.
-     */
-    @Nullable private Duration maxAge;
-    
-    /** 
-     * List of requested authentication context class reference values. 
-     * Values appear in order of preference. Optional. 
-     */
-    @Nonnull @NotLive private List<ACR> acrs;
-    
+
     /** The response mode. Optional. */
     @Nullable private ResponseMode responseMode;
     
@@ -101,8 +64,6 @@ public class OAuthAuthorizationRequest {
      */
     @Nullable private ResponseMode defaultResponseMode;
     
-    //TODO there are a few others.
-    
     /**
      * 
      * Constructor.
@@ -111,7 +72,6 @@ public class OAuthAuthorizationRequest {
      */
     public OAuthAuthorizationRequest(@Nonnull final ClientID id) {        
         clientID = Constraint.isNotNull(id, "ClientID can not be null");
-        acrs = Collections.emptyList();
         scope = new Scope();
         
     }
@@ -219,24 +179,6 @@ public class OAuthAuthorizationRequest {
         endpointURI =  Constraint.isNotNull(uri,"EndpointURI can not be null");
     }
 
-    /**
-     * Get the nonce. 
-     * 
-     * @return the nonce.
-     */
-    @Nullable public Nonce getNonce() {
-        return nonce;
-    }
-
-    /**
-     * Set the nonce. 
-     * 
-     * @param theNonce The nonce to set.
-     */
-    public void setNonce(@Nullable final Nonce theNonce) {
-        nonce = theNonce;
-    }
-
     /**
      * Get the scope. 
      * 
@@ -246,80 +188,6 @@ public class OAuthAuthorizationRequest {
         return scope;
     }
 
-    /**
-     * Get the display.
-     * 
-     * @return the display.
-     */
-    @Nullable public Display getDisplay() {
-        return display;
-    }
-
-    /**
-     * Set the display. 
-     * 
-     * @param theDisplay The display to set.
-     */
-    public void setDisplay(@Nullable final Display theDisplay) {
-        display = theDisplay;
-    }
-
-    /**
-     * Get the prompt. 
-     * 
-     * @return the prompt.
-     */
-    @Nullable public Prompt getPrompt() {
-        return prompt;
-    }
-
-    /**
-     * Set the prompt. 
-     * 
-     * @param thePrompt The prompt to set.
-     */
-    public void setPrompt(@Nullable final Prompt thePrompt) {
-        prompt = thePrompt;
-    }
-
-    /**
-     * Get the max age.
-     * 
-     * @return the maxAge.
-     */
-    @Nullable public Duration getMaxAge() {
-        return maxAge;
-    }
-
-    /**
-     * Set the max age.
-     * 
-     * @param max The maxAge to set.
-     */
-    public void setMaxAge(@Nullable final Duration max) {
-        maxAge = max;
-    }
-
-    /**
-     * Get the ACRs.
-     * 
-     * @return the acrs.
-     */
-    @Nonnull @NotLive @Unmodifiable public List<ACR> getAcrs() {
-        return Collections.unmodifiableList(acrs);
-    }
-
-    /**
-     * Set the ACRs.
-     * 
-     * @param theAcrs The acrs to set.
-     */
-    public void setAcrs(@Nullable final List<ACR> theAcrs) {
-        if (theAcrs != null) {
-            acrs = Collections.unmodifiableList(theAcrs);
-        }
-    }
-
     /**
      * Get the response mode.
      * 
diff --git a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OIDCAuthenticationRequest.java b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OIDCAuthenticationRequest.java
index a6995a5..745f433 100644
--- a/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OIDCAuthenticationRequest.java
+++ b/oidc-common-profile-api/src/main/java/net/shibboleth/oidc/profile/core/OIDCAuthenticationRequest.java
@@ -18,16 +18,25 @@
 package net.shibboleth.oidc.profile.core;
 
 import java.net.URI;
+import java.time.Duration;
+import java.util.Collections;
+import java.util.List;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
 import com.nimbusds.jwt.JWT;
 import com.nimbusds.oauth2.sdk.id.ClientID;
+import com.nimbusds.openid.connect.sdk.Display;
+import com.nimbusds.openid.connect.sdk.Nonce;
 import com.nimbusds.openid.connect.sdk.OIDCClaimsRequest;
+import com.nimbusds.openid.connect.sdk.Prompt;
+import com.nimbusds.openid.connect.sdk.claims.ACR;
 import com.nimbusds.openid.connect.sdk.claims.ClaimsSet;
 
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
+import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 
 /**
  * OpenID Connect Authentication Request. Extends the OAuth 2.0 authorization request.
@@ -59,6 +68,34 @@ public class OIDCAuthenticationRequest extends OAuthAuthorizationRequest {
     /** Hint to the Authorization Server about the login identifier the End-User might use to log in.*/
     @Nullable private String loginHint;
     
+    /**
+     * ASCII string value that specifies how the Authorization Server 
+     * displays the authentication and consent user interface pages to the End-User.
+     */
+    @Nullable private Display display;
+    
+    /**
+     * Space delimited, case sensitive list of ASCII string values that 
+     * specifies whether the Authorization Server prompts the End-User 
+     * for reauthentication and consent.
+     */
+    @Nullable private Prompt prompt;
+    
+    /** 
+     * Specifies the allowable elapsed time in seconds since the last time 
+     * the End-User was actively authenticated by the OP.
+     */
+    @Nullable private Duration maxAge;
+    
+    /** 
+     * List of requested authentication context class reference values. 
+     * Values appear in order of preference. Optional. 
+     */
+    @Nonnull @NotLive private List<ACR> acrs;
+
+    /** The nonce. */
+    @Nullable private Nonce nonce;
+    
     /**
      * 
      * Constructor.
@@ -69,6 +106,7 @@ public class OIDCAuthenticationRequest extends OAuthAuthorizationRequest {
         super(id);
         // Must contain the openid scope. 
         getScope().add(DEFAULT_OPENID_SCOPE);
+        acrs = Collections.emptyList();
     }
     
     /**
@@ -186,7 +224,7 @@ public class OIDCAuthenticationRequest extends OAuthAuthorizationRequest {
      * 
      * @since 2.2.0
      */
-    public void setLoginHint(final String hint) {
+    public void setLoginHint(@Nullable final String hint) {
         loginHint = hint;
         
     } 
@@ -202,9 +240,97 @@ public class OIDCAuthenticationRequest extends OAuthAuthorizationRequest {
         return loginHint;
     }
     
-    
+   /** Get the display.
+    * 
+    * @return the display.
+    */
+   @Nullable public Display getDisplay() {
+       return display;
+   }
+
+   /**
+    * Set the display. 
+    * 
+    * @param theDisplay The display to set.
+    */
+   public void setDisplay(@Nullable final Display theDisplay) {
+       display = theDisplay;
+   }
+
+   /**
+    * Get the prompt. 
+    * 
+    * @return the prompt.
+    */
+   @Nullable public Prompt getPrompt() {
+       return prompt;
+   }
+
+   /**
+    * Set the prompt. 
+    * 
+    * @param thePrompt The prompt to set.
+    */
+   public void setPrompt(@Nullable final Prompt thePrompt) {
+       prompt = thePrompt;
+   }
+
+   /**
+    * Get the max age.
+    * 
+    * @return the maxAge.
+    */
+   @Nullable public Duration getMaxAge() {
+       return maxAge;
+   }
+
+   /**
+    * Set the max age.
+    * 
+    * @param max The maxAge to set.
+    */
+   public void setMaxAge(@Nullable final Duration max) {
+       maxAge = max;
+   }
+
+   /**
+    * Get the ACRs.
+    * 
+    * @return the acrs.
+    */
+   @Nonnull @NotLive @Unmodifiable public List<ACR> getAcrs() {
+       return Collections.unmodifiableList(acrs);
+   }
+
+   /**
+    * Set the ACRs.
+    * 
+    * @param theAcrs The acrs to set.
+    */
+   public void setAcrs(@Nullable final List<ACR> theAcrs) {
+       if (theAcrs != null) {
+           acrs = Collections.unmodifiableList(theAcrs);
+       }
+   }
+   
+   /**
+    * Get the nonce. 
+    * 
+    * @return the nonce.
+    */
+   @Nullable public Nonce getNonce() {
+       return nonce;
+   }
+
+   /**
+    * Set the nonce. 
+    * 
+    * @param theNonce The nonce to set.
+    */
+   public void setNonce(@Nullable final Nonce theNonce) {
+       nonce = theNonce;
+   }
+
     //TODO others relating to sections 5.2, 5.5, 6, and 7.2.1
     
-    
-
 }

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


More information about the commits mailing list