I'm enabling OAuth2 on an SPA as follows:
- The implicit grant type is the only grant type supported
- My Angular 5 app uses HashLocationStrategy for its routing
I cannot change either of these constraints.
When I log in to my app and get redirected, the redirect url from the authorize endpoint looks like this:
http://foo/#access_token=(ey...)&token_type=bearer&state=(state...)&expires_in=43199&jti=(jti...)
This is as expected according to the OAuth2 spec; the parameters present in the redirect url must be appended as a fragment (following the '#').
The problem I'm having is that Angular is interpreting the characters following the hash according to its hash location strategy. It is attempting to redirect to path access_token=...
which does not exist.
How do I get around this?