Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enc_id_token vs id_token #501

Open
heidingeww opened this issue Dec 13, 2023 · 1 comment
Open

enc_id_token vs id_token #501

heidingeww opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@heidingeww
Copy link

Why is enc_id_token separated from id_token? It looks like its being set the same way here. I assume enc means encrypted? It doesn't seem so as for how it is being set though.

It is setting the session_token as enc_id_token here. We can see that params["id_token_hint"] will only get set if the session_token exists, which means enc_id_token has to be true in opts.session_contents

Any inputs would be appreciated. Thank you!

@bodewig
Copy link
Collaborator

bodewig commented Dec 14, 2023

enc_ means encoded in this context. If you look closely you will see they are set to separate values :-)

enc_id_token is the raw id token - the dot separated base64 parts. id_token is a table holding the parsed payload of the token.

When sending the token back to the OIDC provider lua-resty-openidc needs the original string as it cannot generally reconstruct the exact same representation from the parsed payload (it wouldn't be able to sign the token for example). So yes, if you want to use the id_token_hint during logout you must store the enc_id_token as part of the session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants