[java-identity-provider COMMIT] in /trunk: idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ProtocolParam.ja...

noreply at shibboleth.net noreply at shibboleth.net
Thu Mar 3 11:13:27 EST 2016


Author: serac
Date: Thu Mar  3 11:13:26 2016
New Revision: 8121

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8121&view=rev
Log:
IDP-928 Add support for CAS 3.0 method parameter.

Added:
    trunk/idp-conf/src/main/resources/system/views/cas/postBack.vm
Modified:
    trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ProtocolParam.java
    trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketRequest.java
    trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketResponse.java
    trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/flow/impl/InitializeLoginAction.java
    trunk/idp-conf/src/main/resources/system/flows/cas/login/login-flow.xml
    trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java

Modified: trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ProtocolParam.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ProtocolParam.java?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ProtocolParam.java	(original)
+++ trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ProtocolParam.java	Thu Mar  3 11:13:26 2016
@@ -36,6 +36,13 @@
     /** Gateway authentication flag. */
     Gateway,
 
+    /**
+     * Method parameter.
+     *
+     * @since CAS Protocol 3.0
+     */
+    Method,
+
     /** Proxy-granting ticket. */
     Pgt,
 

Modified: trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketRequest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketRequest.java?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketRequest.java	(original)
+++ trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketRequest.java	Thu Mar  3 11:13:26 2016
@@ -26,6 +26,13 @@
  * @author Marvin S. Addison
  */
 public class ServiceTicketRequest {
+
+    /** HTTP GET method. */
+    public static final String METHOD_GET = "GET";
+
+    /** HTTP POST method. */
+    public static final String METHOD_POST = "POST";
+
     /** Service URL */
     @Nonnull private final String service;
 
@@ -37,6 +44,9 @@
 
     /** Flag indicating whether ticket request is via SAML 1.1 protocol. */
     private boolean saml;
+
+    /** CAS protocol 3.0 "method" parameter. */
+    private String method = METHOD_GET;
 
 
     public ServiceTicketRequest(@Nonnull final String service) {
@@ -70,4 +80,31 @@
     public void setSAML(final boolean saml) {
         this.saml = saml;
     }
+
+    /**
+     * Gets the value of the <code>method</code> parameter. Default is {@value #METHOD_GET}.
+     *
+     * @return {@value #METHOD_GET} or {@value #METHOD_POST}.
+     */
+    @Nonnull public String getMethod() {
+        return method;
+    }
+
+    /**
+     * Sets the value of the <code>method</code> parameter.
+     * See <a href="http://jasig.github.io/cas/development/protocol/CAS-Protocol-Specification.html#head2.1.1">
+     *     http://jasig.github.io/cas/development/protocol/CAS-Protocol-Specification.html#head2.1.1</a> for more
+     * information.
+     *
+     * @param method {@value #METHOD_GET} or {@value #METHOD_POST}.
+     */
+    public void setMethod(final String method) {
+        if (METHOD_GET.equalsIgnoreCase(method)) {
+            this.method = METHOD_GET;
+        } else if (METHOD_POST.equalsIgnoreCase(method)) {
+            this.method = METHOD_POST;
+        } else {
+            throw new IllegalArgumentException("Unsupported method " + method);
+        }
+    }
 }

Modified: trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketResponse.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketResponse.java?rev=8121&r1=8120&r2=8121&view=diff
==============================================================================
--- trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketResponse.java	(original)
+++ trunk/idp-cas-api/src/main/java/net/shibboleth/idp/cas/protocol/ServiceTicketResponse.java	Thu Mar  3 11:13:26 2016
@@ -67,13 +67,22 @@
         this.saml = saml;
     }
 
+    /**
+     * @return The name of the ticket parameter returned to the requesting service.
+     */
+    public String getTicketParameterName() {
+        if (saml) {
+            return SamlParam.SAMLart.name();
+        }
+        return ProtocolParam.Ticket.id();
+    }
+
+    /**
+     * @return URL that may be used to redirect to a service with a granted ticket.
+     */
     public String getRedirectUrl() {
         final UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(service);
-        if (saml) {

[... 155 lines stripped ...]


More information about the commits mailing list