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

[Bug]: Logoff and Id Token #1602

Closed
julienvonoetinger-eaton opened this issue Nov 22, 2022 · 10 comments · Fixed by #1604
Closed

[Bug]: Logoff and Id Token #1602

julienvonoetinger-eaton opened this issue Nov 22, 2022 · 10 comments · Fixed by #1604
Assignees

Comments

@julienvonoetinger-eaton
Copy link

julienvonoetinger-eaton commented Nov 22, 2022

Version

15.0.0

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

In the previous version, when I was calling the logoff function, it was calling the following "endsession" url:

/connect/endsession?id_token_hint=eyJhbGciOiJSUzI1NiIsImtpZCI6IkFGRjE3QkM2RUYwQjFCMDJCQ0QzQ0ZFNDg0QTdENEYwQjg4MzU2Q0IiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJyX0Y3eHU4TEd3SzgwOF9raEtmVThMaURWc3MifQ.eyJuYmYiOjE2NjkxMDYzNzcsImV4cCI6MTY2OTEwNjY3NywiaXNzIjoiaHR0cHM6Ly9sb2dpbi5kZXYuZ3JlZW5tb3Rpb24udGVjaCIsImF1ZCI6IkdyZWVuTW90aW9uLkNoYXJnaW5nTmV0d29ya01hbmFnZXIuU3BhIiwibm9uY2UiOiIyMjhhZWZlNzYwMDAwZGFmNDlmOGFhOWJmMWNhZDU5ZWY4SlRpajFhSyIsImlhdCI6MTY2OTEwNjM3NywiYXRfaGFzaCI6Ik1nMldzVjB6Y2lwdlNKUUFWOHFIdGciLCJzX2hhc2giOiJyd2JvRXNKd2wtc2gxMFRIdkRZcU9BIiwic2lkIjoiSTJCWk9ROGotbm0tVjZOS1JfU2E3QSIsInN1YiI6IjE1MThlODllLTkzZGQtNDRiMy1iNzZhLTAyZTFhMDFmODMxYyIsImF1dGhfdGltZSI6MTY2OTEwNTM1MCwiaWRwIjoibG9jYWwiLCJhbXIiOlsicHdkIl19.qQ6rAh1YHeBTGwxJHGReIIcmCdldGLBCfBcbcqWA1LrMEdbfaryURMG6xSKYHwiysEJ-jn6KMEMI1HctQ0LtAyxhRgxWJEPKq4IlXfGgIGfpCzYNjvugBLo6VzVBW8-BFu8GnOW8Eflt8PjAJngdz7b28sL1fLQulsUp1UR3q4LyBp2ZWl51xIvk3G64PsdoJg70j-39SlhrtDqNxeVG6Bp6uONQk3IS34uMJlXOoK0TfB5FHNax8AnhsMzGpkge6i1tFph73uiDmqryKs80o-A4hRM8HpYI2igKj4f5gHTSouR_NNJ-90aIM1kgAc38jz8NHVVyeFDpCLAO5rw25w&post_logout_redirect_uri=https%3A%2F%2Fwww.dev.chargingnetworkmanager.eu

But after upgrading to 15.0.0 it's calling this:

/connect/endsession?post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A4200

I have debugged a bit and I have noticed that the logoff function is calling this.resetAuthDataService.resetAuthorizationData(config, allConfigs) which remove the id token from local storage. The next line of code is calling this.urlService.getEndSessionUrl(config, customParams) which try to get to id token from local storage but of course it's already gone. Therefore the id_token_hint is missing from the end session url.

Steps to reproduce the behavior

No response

A clear and concise description of what you expected to happen.

It should call the "endsession" endpoint with the id token parameter.

Additional context

No response

@FabianGosebrink
Copy link
Collaborator

Hey thanks for this issue. I'll have a look on this. We did not notice this during testing but of course we'll have a look. Thanks!

@FabianGosebrink
Copy link
Collaborator

FabianGosebrink commented Nov 23, 2022

Can you provide a sample repo where we can reproduce this? Because in our testing, we did not have this case. Thanks!

@julienvonoetinger-eaton
Copy link
Author

Ok, I'll try to do that asap.

@FabianGosebrink
Copy link
Collaborator

Thanks for your help.

@FabianGosebrink
Copy link
Collaborator

I think you are right, this is a bug. Can I do a PR and you try the lib on the branch of the PR? Then you can let us know whether this fixes your issue or not. Is that okay for you?

@julienvonoetinger-eaton
Copy link
Author

Yes sure

@FabianGosebrink
Copy link
Collaborator

FabianGosebrink commented Nov 23, 2022

Thanks. Check the linked PR. Have to go through it and see if what I found makes sense. Found two other things which were wrong. Thanks! Would not have noticed them without you :) But you can test. Will have a look at the tests now.

@julienvonoetinger-eaton
Copy link
Author

julienvonoetinger-eaton commented Nov 23, 2022

I was able to test your branch and it solves my problem. The endsession url has the correct id_token_hint . Thanks for the quick answer and fix. 👍

@FabianGosebrink
Copy link
Collaborator

Alright, perfect. Thanks for the quick testing. I will fix the tests and we'll do the merge and release then. Thanks! ❤️

@FabianGosebrink
Copy link
Collaborator

Dup #1607

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

Successfully merging a pull request may close this issue.

3 participants