product-service : A simple downstream service having protected routes
jwt-resoure-server : A jar that when included in downstream services make it a resourceserver that extract jwt token and set it in security contex.
eureka-service : Discovery service
zuul-server : Edge server
Okta is my auth server
I have set oauth grant type to be - Authorization code (I know for spa implicit grant type is recommended but lets say due to some constraint in future we are restricted to this grant type)
So angular client after successfully login, auth server revert back to the angular app with authorization code like :
Now I have to hit auth server with this code to get the access and id token.
Since this requires client secret, I have to pass it through zuul (as only back-end service can have client secrets), which should add client_secret to the body and forward the request to auth server.
I’m not sure I’m following completely. It sounds like there are a few questions in here .
Some of this just works out of the box with Spring Security, for example you can setup zuul as your SSO point, and then have that pass the token to your downstream applications. Can you elaborate a little on how you are using Zuul?
It sounds like your Angular app is rendering the login page, using something like the Okta SignIn Widget? If that is the case you want to look into the SPA/implicit flow.
At that point you can use an access token between your applications (assuming you use the @ResourceServer annotation, and things should just work) IIRC Zuul just passes the same access token down stream.
I’m still not 100% sure we are talking about the same thing, sorry in advance, but let us know!