[17.0][ADD] auth_oauth_link_by_email: add new module to allow linking OAuth accounts by email#941
[17.0][ADD] auth_oauth_link_by_email: add new module to allow linking OAuth accounts by email#941zamberjo wants to merge 1 commit into
Conversation
|
Hi @sbidoul, |
|
Hi! auth_oidc has a mechanism to control token fields mapping (see |
|
Hi! The issue is that existing users have an empty ( self.search([("oauth_uid", "=", oauth_uid), ("oauth_provider_id", "=", provider)])Even if token_map is configured with something like |
cc1ae94 to
06d7655
Compare
|
Ah, I see. Then you probably need to create a new module that depends on |
… accounts by email
06d7655 to
2efdb3a
Compare
Done. |
When existing Odoo users (created before OAuth/OIDC was configured) try to log in via an OAuth provider, the system fails to find them because their
oauth_uidis not set, falling through to signup and failing.This module adds an auto-link mechanism: on first OAuth login, if no user is found by
oauth_uid, it attempts to match an existing active user whoseloginequals the email claim from the token, linking them automatically by writing theoauth_uidandoauth_provider_id.Subsequent logins use the standard
oauth_uidlookup with no extra queries.Usage: install
auth_oauth_link_by_email— no configuration needed.