How to create the SAMLAuthenticationToken and send it to the SAML authentication provider

838 views Asked by At

I've configured the SAML extension in my application, and I want to authenticate an user. The flow that I implemented is the following:

  1. Getting the user credentials (username and password) from a rest service.
  2. Configuring application to use SAMLAuthenticationProvider.
  3. Building a SAMLAuthenticationToken object to be sent to the SAMLAuthenticationProvider.
  4. Building the SAMLMessageContext which will be inyected to SAMLAuthenticationToken.

But I've not been able to build the SAMLMessageContext object which I guess that will wrap the user credentials (among other data) that I got from the rest service.

Does anybody know how to build this object?. or if is the flow correct?

thanks.

1

There are 1 answers

0
Vladimír Schäfer On

You do not provide credentials to your SP when using SAML authentication. Credentials are only presented to the IDP during authentication. So the flow is incorrect.

Good starting points to learn more are SAML 2.0 wiki page, SAML 2.0 standard itself and the Spring SAML manual. This issue has also been discussed couple of times here on Stackoverflow, so you can find more in old questions.