andreassolberg / jso

Easy to use OAuth 2.0 javascript library for use in your javascript application.
Other
884 stars 166 forks source link

How to parse an id_token parameter in the response #102

Open marschaeffer opened 5 years ago

marschaeffer commented 5 years ago

Our keycloak returns an auth-token via the "id_token" parameter after login, but src/JSO.js:278 parses only the "access_token" parameter in the url.

https://github.com/andreassolberg/jso/blob/b1be102c5c8eedb15c38dea2ba56d83b749eed94/src/JSO.js#L278

Is there some advice how to make parsing an id_token possible with JSO (response_type=id_token)? Thanks!

ViltusVilks commented 4 years ago

Have you found solution? I have same problem with (latest) Keycloak.. Auth flow is ok untill comes back to callback URI with this error.

marschaeffer commented 4 years ago

@ViltusVilks I copy/pasted JSO.js in my project and changed it to my needs. Actually too specific changes to open a PR. (Please be aware that it is not recommended to store tokens in the browsers storage, like JSO does. I moved to auth0-spa-js, but needed to change a lot there as well (it is very specific for auth0 openid software)).

dosstx commented 4 years ago

How much did you have to change with auth0? I was looking at that as an alternative.