This gist is a collection of resources on the topic of SPA Authentication Flow for Browser Applications.
- Stormpath
- OWASP
- Auth0
- Two Cookie JWT Approach
The simplest solution for SPA Authentication Flow for Browser Applications is to have a normal session based authentication flow and an API Gateway. Whenever the client tries to access data from the API, they need to call the gateway which authenticates the client and the gateway calls the API. After the gateway receives the data it simpli returns the unmodified data to the client.
+---------+
| API |
+---------+
^ |
| | Some kind of token to identify Gateway application eg. Oauth 2.0 token.
| v
+---------+
| Gateway |
+---------+
^ |
| | Browser cookie based authentication flow.
| v
+---------+
| SPA |
+---------+