SAML2 request POST vs GET CAS 5.3.14??

215 views
Skip to first unread message

Keith Alston (Staff)

unread,
Apr 19, 2021, 12:41:29 PM4/19/21
to cas-...@apereo.org
It seems that my CAS SAML2.0 idp is handling SAML2 services that do GET requests just fine. 
But when I have an SP that does a SAML2 POST request my idp is not reading the parameters 
and I get the "Application Not Authorized to Use CAS" message instead of the auth page. Difference being
parameters in the URI vs parameters in the POST body. Anyone have
any idea where I might look to resolve this issue? Are there certain parameters in the service definition
that I should be including? Something I'm missing in cas.properties? The audit log does not show POST
requests as SAML2_POST though SAML trace does show it as a SAML request. Any clue here would be
helpful. TIA!

Keith Alston
Regent University
IT Department

Richard Frovarp

unread,
Apr 19, 2021, 12:49:38 PM4/19/21
to cas-...@apereo.org
Since I saw someone create the URL by hand the other day, I'm going to ask the simple question: is the request hitting the HTTP-POST binding location? POST and Redirect are two different URLs in CAS (and I'm guessing most IdPs).

I've never had to do anything different to handle the two different types of SPs on that version.

Keith Alston (Staff)

unread,
Apr 19, 2021, 1:00:43 PM4/19/21
to cas-...@apereo.org
Looks like my post URL is:


I guess the get url has redirect in it??

Keith Alston
Regent University
IT Department

From: 'Richard Frovarp' via CAS Community <cas-...@apereo.org>
Sent: Monday, April 19, 2021 12:49 PM
To: cas-...@apereo.org <cas-...@apereo.org>
Subject: [External] Re: [cas-user] SAML2 request POST vs GET CAS 5.3.14??
 
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/6bad321c10587be379a7cec181afa435c58c8b3e.camel%40ndsu.edu.

Keith Alston (Staff)

unread,
Apr 19, 2021, 1:26:10 PM4/19/21
to cas-...@apereo.org
I take that back. Zoom works and it does a post request. 
saml-tracer show this. Zoom works, minitab  doesnt. 

minitab request---------------------------------------------------------------------------
<samlp:AuthnRequest ID="id8f7ae58c-c17e-4090-a89d-f18b8bb5e9f0"
                    Version="2.0"
                    IssueInstant="2021-04-19T17:07:59.6881619Z"
                    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                    Destination="https://casdev.regent.edu/cas/idp/profile/SAML2/POST/SSO"
                    >
    <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://licensing.minitab.com</Issuer>

zoom request------------------------------------------------------------------------------
<saml2p:AuthnRequest AssertionConsumerServiceURL="https://regent.zoom.us/saml/SSO"
                     Destination="https://cas.regent.edu/cas/idp/profile/SAML2/POST/SSO"
                     ForceAuthn="false"
                     ID="a3e6a45e921c2290-5af0f9c82h9cheh"
                     IsPassive="false"
                     IssueInstant="2021-04-19T17:15:37.720Z"
                     ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
                     Version="2.0"
                     xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
                     >
    <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">regent.zoom.us</saml2:Issuer>

here are the service files for each:

zoom service file:
{
  "@class" : "org.apereo.cas.support.saml.services.SamlRegisteredService",
  "serviceId" : "regent.zoom.us",
  "name" : "regent.zoom.us",
  "id" : 10000008,
  "metadataLocation" : "file:/etc/cas/config/zoom-metadata-prod.xml",
  "evaluationOrder" : 6,
  "requiredNameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
  "usernameAttributeProvider" : {
    "@class" : "org.apereo.cas.services.PrincipalAttributeRegisteredServiceUsernameProvider",
    "usernameAttribute" : "mail",
  }
}


minitab service file:
{
  "@class" : "org.apereo.cas.support.saml.services.SamlRegisteredService",
  "serviceId" : "https://licensing.minitab.com",
  "name" : "minitab",
  "id" : 1617641399,
  "metadataLocation" : "file:/etc/cas/config/minitab-com-metadata.xml",
  "evaluationOrder" : 2,
  "requiredNameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
  "usernameAttributeProvider" : {
    "@class" : "org.apereo.cas.services.PrincipalAttributeRegisteredServiceUsernameProvider",
    "usernameAttribute" : "emailAddress",
  },
  "attributeReleasePolicy" : {
    "@class" : "org.apereo.cas.services.ReturnMappedAttributeReleasePolicy",
    "allowedAttributes" : {
      "@class" : "java.util.TreeMap",
      "ExtensionAttribute1" : "Email",
      "givenname" : "FirstName",
      "sn" : "LastName"
    }
  }
}




Keith Alston
Regent University
IT Department

From: cas-...@apereo.org <cas-...@apereo.org> on behalf of Keith Alston (Staff) <kei...@regent.edu>
Sent: Monday, April 19, 2021 1:00 PM

Richard Frovarp

unread,
Apr 19, 2021, 2:19:52 PM4/19/21
to cas-...@apereo.org
You are probably going to need to take a look in the CAS logs. It seems that it should match, but the logs should tell you exactly what it is searching for. It will also tell you if there was an error loading the service file when it first tried to update it. 

Ray Bon

unread,
Apr 19, 2021, 2:35:38 PM4/19/21
to cas-...@apereo.org
Keith,

The destination URLs are different, cas and casdev.
Is minitab routing to cas or casdev and is your service defined there?

Ray

On Mon, 2021-04-19 at 17:26 +0000, Keith Alston (Staff) wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

Keith Alston (Staff)

unread,
Apr 19, 2021, 2:51:39 PM4/19/21
to cas-...@apereo.org
Yes, zoom is in production. minitab in my dev environment. Both 5.3.14. pretty much the exact same setup.

Keith Alston
Regent University
IT Department

From: cas-...@apereo.org <cas-...@apereo.org> on behalf of Ray Bon <rb...@uvic.ca>
Sent: Monday, April 19, 2021 2:35 PM

To: cas-...@apereo.org <cas-...@apereo.org>
Subject: [External] Re: [cas-user] SAML2 request POST vs GET CAS 5.3.14??
Keith,

The destination URLs are different, cas and casdev.
Is minitab routing to cas or casdev and is your service defined there?

Ray

On Mon, 2021-04-19 at 17:26 +0000, Keith Alston (Staff) wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

I take that back. Zoom works and it does a post request. 
saml-tracer show this. Zoom works, minitab  doesnt. 

minitab request---------------------------------------------------------------------------
<samlp:AuthnRequest ID="id8f7ae58c-c17e-4090-a89d-f18b8bb5e9f0"
                    Version="2.0"
                    IssueInstant="2021-04-19T17:07:59.6881619Z"
                    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                    Destination="https://casdev.regent.edu/cas/idp/profile/SAML2/POST/SSO%22
                    >
    <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://licensing.minitab.com</Issuer>

zoom request------------------------------------------------------------------------------
<saml2p:AuthnRequest AssertionConsumerServiceURL="https://regent.zoom.us/saml/SSO%22
                     Destination="https://cas.regent.edu/cas/idp/profile/SAML2/POST/SSO%22

Keith Alston (Staff)

unread,
Apr 19, 2021, 3:36:18 PM4/19/21
to cas-...@apereo.org
Hmmm, metadata expired. So I changed the expire date in the metadata. Now I'm getting this:

RootCasException(code=UNSATISFIED_SAML_REQUEST)
at org.apereo.cas.support.saml.web.idp.profile.builders.enc.SamlObjectSignatureValidator.validateSignatureOnProfileRequest(SamlObjectSignatureValidator.java:226)

Progress!!! But still not quite there. Maybe I need to request a new metadata file.

from the log:
2021-04-19 15:23:52,554 DEBUG [org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade] - <Located SP SSODescriptor in metadata for [https://licensing.minitab.com]. Metadata is valid until [forever]>2021-04-19 15:23:52,554 DEBUG [org.apereo.cas.support.saml.web.idp.profile.AbstractSamlProfileHandlerController] - <The authentication context is signed; Proceeding to validate signatures...>
2021-04-19 15:23:52,558 DEBUG [org.apereo.cas.support.saml.web.idp.profile.builders.enc.SamlObjectSignatureValidator] - <Validating signature for [org.opensaml.saml.saml2.core.impl.AuthnRequestImpl]>2021-04-19 15:23:52,561 DEBUG [org.apereo.cas.support.saml.web.idp.profile.builders.enc.SamlObjectSignatureValidator] - <Validating profile signature for [org.opensaml.saml.saml2.core.impl.IssuerImpl@131b7db5] via [SAMLSignatureProfileValidator]...>2021-04-19 15:23:52,570 DEBUG [org.opensaml.saml.security.impl.SAMLSignatureProfileValidator] - <Saw Enveloped signature transform>
2021-04-19 15:23:52,570 DEBUG [org.opensaml.saml.security.impl.SAMLSignatureProfileValidator] - <Saw Exclusive C14N signature transform>2021-04-19 15:23:52,570 DEBUG [org.apereo.cas.support.saml.web.idp.profile.builders.enc.SamlObjectSignatureValidator] - <Successfully validated profile signature for [org.opensaml.saml.saml2.core.impl.IssuerImpl@131b7db5].>

...

2021-04-19 15:23:52,614 DEBUG [org.apereo.cas.web.FlowExecutionExceptionResolver] - <Ignoring the received exception due to a type mismatch>org.apereo.cas.support.saml.SamlException: Signing credentials for validation could not be resolved based on the provided signature

Keith Alston
Regent University
IT Department

From: 'Richard Frovarp' via CAS Community <cas-...@apereo.org>
Sent: Monday, April 19, 2021 2:19 PM

To: cas-...@apereo.org <cas-...@apereo.org>
Subject: [External] Re: [cas-user] SAML2 request POST vs GET CAS 5.3.14??
You are probably going to need to take a look in the CAS logs. It seems that it should match, but the logs should tell you exactly what it is searching for. It will also tell you if there was an error loading the service file when it first tried to update it. 

On Mon, 2021-04-19 at 17:26 +0000, Keith Alston (Staff) wrote:
I take that back. Zoom works and it does a post request. 
saml-tracer show this. Zoom works, minitab  doesnt. 

minitab request---------------------------------------------------------------------------
<samlp:AuthnRequest ID="id8f7ae58c-c17e-4090-a89d-f18b8bb5e9f0"
                    Version="2.0"
                    IssueInstant="2021-04-19T17:07:59.6881619Z"
                    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                    Destination="https://casdev.regent.edu/cas/idp/profile/SAML2/POST/SSO%22
                    >
    <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://licensing.minitab.com</Issuer>

zoom request------------------------------------------------------------------------------
<saml2p:AuthnRequest AssertionConsumerServiceURL="https://regent.zoom.us/saml/SSO%22
                     Destination="https://cas.regent.edu/cas/idp/profile/SAML2/POST/SSO%22

Keith Alston (Staff)

unread,
Apr 19, 2021, 3:56:22 PM4/19/21
to cas-...@apereo.org
Scratch that. I needed an updated metadata file. Now I can authenticate and get forwarded to the sp. Then
I get an error there. I may not be registered in their system. Waiting on a response from them.

Thanks!!! This has been very helpful!

Keith Alston
Regent University
IT Department

From: cas-...@apereo.org <cas-...@apereo.org> on behalf of Keith Alston (Staff) <kei...@regent.edu>
Sent: Monday, April 19, 2021 3:36 PM

Richard Frovarp

unread,
Apr 19, 2021, 4:53:00 PM4/19/21
to cas-...@apereo.org
If they have a public metadata file you can put the URL in the metadata configuration element instead of the static file. CAS will download and cache the metadata file on some sort of updating schedule ( I don't remember the specifics), but it will help ensure you have updated metadata.
Reply all
Reply to author
Forward
0 new messages