[WIP] Add Implicit Grant Flow support #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add implicit flow support in the library for oauth2 and openid connect.
The way it works is the following:
Point 5. is needed, because the browsers don't send the URL fragment, when they do a GET after a HTTP Redirect.
The new public functions introduced are in implicit.go.
Unfortunately to keep backwards compatibility I could not refactor some of the server fields in the Config struct, so I had to copy them to a dedicated struct.
An example of using the library has been added as well.
This is marked as WIP due to several reasons:
token
,id_token
ortoken id_token
have different requirements when doing the request and receiving the response (e.g. you have to use the scopeopenid
when requestingid_token
,redirect_uri
is required for openid connect and more). Therefore would it make more sense to move those functions to separate packages and each having a dedicated struct?More info
https://tools.ietf.org/html/rfc6749#section-4.2
https://openid.net/specs/openid-connect-core-1_0.html#ImplicitFlowAuth