Reputation: 763
I'm building a full stack application. The frontend will be a SPA and the backend part is going to be statelss restful API across several resource servers. Also, I'd like to separate the authentication & authorization as a micro service and is thinking to use OAuth2 as the protocol.
The target flow will be like the SPA user will submit ID/password to the auth service and the OAuth2 server will respond with access token. In subsequent resource requests the SPA will submit together with the access token to the resource server and resource server will then ask the auth server to validate the token.
My question is that does OAuth2 fit the above scenario and if it's the case, which OAuth2 grant type/flow I should use?
Upvotes: 0
Views: 329
Reputation: 1842
The Authorization Code grant type should work perfectly for you - this is how it would typically work:
Upvotes: 3