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

[Question] How to support additional emails with Open ID Connect login #8040

Closed
gkapkowski opened this issue May 1, 2021 · 5 comments
Closed
Assignees
Milestone

Comments

@gkapkowski
Copy link

Hi, I would like to allow users to use their additional emails (identities) returned in id_token from identity provider.

How I would go about it? As far as I saw the id_token is not stored in the session so hooking into login_after to create those additional identities will not work (or I'm wrong?)

@thomascube
Copy link
Member

I guess this could be solved with a plugin and an according hook.

@thomascube thomascube self-assigned this May 3, 2021
@alecpl alecpl added this to the later milestone May 4, 2021
thomascube added a commit that referenced this issue May 4, 2021
`oauth_login`: triggered after successful authentication via OAuth, providing token and identity information

`oauth_refresh_token`: triggered after the OAuth access token was refreshed
@thomascube
Copy link
Member

Added hook oauth_login. See documentation: https://github.com/roundcube/roundcubemail/wiki/Plugin-Hooks#oauth_login

@thomascube
Copy link
Member

Closing this issue for now. Please try using that hook in a plugin and report back if something's missing.

@gkapkowski
Copy link
Author

@thomascube I'm getting back to this issue, I was able to use this hook but I have problem with rcmail->user->insert_identity().
From what I was able to gather, at the time when this hook is fired the user instance has no ID set and inserting the identity fails.

I haven't read through all the code so I'm not sure how to deal with this issue. What would you propose? Is there any obvious way?

@gkapkowski
Copy link
Author

Solved it for now with passing identity info in private variable and using it in login_after hook

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

No branches or pull requests

3 participants