Hi all,
I met a quite known problem with oauth2 and think I found one of (or the ?) reason.
Symptoms:
- agents can login/logout several time using oauth2 without any problem (using /scp/)
- users can login using oauth2 in when their account don't exist (account creation, using /)
- users can't login anymore using oauth2 (after disconnect) if there account has already been created
On my oauth2 account, my username (let's say g.articket@mydomain.tld) is NOT my email (garticket@mydomain.tld). Oauth2 provide the two values to osticket (username and email)
On auth2 plugin, agent and user auth code work differently for some strange reasons :
- agent code always make use of "user identifier" (at creation, at login and osticket treats it as an email address)
- user code registers new account using "user identifier" and then tests login using email.
My setup failed while using the default (or found online ?) values:
- User Identifier: userPrincipalName
- Email Address: mail
Switching to the following solved my problem :
- User Identifier: mail
- Email Address: mail
I hope this helps. I feel like there's some code to review in oauth2 plugin to implement the same behavior in agent/user login code. BTW, the oauth2 instance setup form could probably benefit of some clearer instructions about User Identifier (userPrincipalName vs. mail).
I hope this will help.
Regards,
G.