oauth2orize-openid-examples
oauth2orize-openid-examples copied to clipboard
Enhancement : add id_token generation example
I believe it is critical to include an example of JWT id_token generation since OIDC id_tokens are all about JWT as far as I get it from the specs. So it would be nice to get an example of best practices and recommended modules to use for generating a JWT id_token.
Currently, all OIDC extensions in the example leave the id_token
generation up to the user. Which to my opinion is confusing
server.grant(oauth2orize_ext.grant.idToken(function(client, user, done){
var id_token;
// Do your lookup/token generation.
// ... id_token =
done(null, id_token);
}));
https://github.com/gerges-beshay/oauth2orize-openid-examples/blob/master/oauth2.js#L43