J
J
jeston2020-01-14 16:21:54
Java
jeston, 2020-01-14 16:21:54

How to correctly issue a JWT token after SAML authorization?

Actually, there is a certain client application that can go to the service that issues the jwt token, which is used to communicate in the future. Now I need to add SSO authorization before issuing a JWT token. I use the Spring SAML extension for this, and I'm actually interested in whether a valid flow can be used for such a case:
1. The web application sends a GET request to /sso/auth-endpoint
2 The SpringSecurity context is analyzed and if there is an anonymous user, a 401 error is returned to the client
3. As a result, the angular application will redirect to the SSO server where the user enters his credentials
4. A long chain of filters is launched, where I added my

.addFilterAfter(jwtProducerFilter, BasicAuthenticationFilter::class.java)

5. A request with SAMLresponse and RelayState parameters gets there
6. Here I can add a generated token to the response header, but the problem is that Spring Security generates a 302 request here. As a result, my token reaches the browser, which does not transfer control to java|script , and immediately performs a redirect on the Location-field of the request
Actually, the question is - what experience exists in this case? I need to give the client application a jwt token after SAML authorization is completed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2020-01-16
@alfss

https://docs.pivotal.io/p-identity/1-10/common-pat... Maybe this will help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question