OpenID - can I associate my login with existing Traccar account?

David Cole 2 days ago

Managed to get OpenID working with Pocket-id, only problem, is it's created a new traccar account with the email address from Pocket-ID.

In some other projects where this has been enabled, I've been able to associate an existing traccar user with the openid authorised user. I was hoping there was some sort of attribute I could see in the new pocket-id created user that I could transfer to my existing local traccar user. Or is there some DB magic I could perform?

Anton Tananaev 2 days ago

If the email address matches, it should work with existing accounts.

David Cole 2 days ago

And if they dont? as my pocket-id user has a different email address to my traccar default user

Anton Tananaev 2 days ago

Then it won't work. Why can't you change the email?

David Cole 2 days ago

Oh so if I update the email address in traccar will it then match and allow login?

David Cole 2 days ago

So i changed email address on traccar account (and deleted the newly created one made by openid) and I was able to log on.

But I lose my admin access.

I've added these settings:

<entry key='openid.allowGroup'>traccar_user</entry>
<entry key='openid.adminGroup'>traccar_admin</entry>

The doco doesn't say how to use it:
openid.allowGroup - A group to restrict access to.
openid.adminGroup - The group to grant admin access to.

Is this a group in traccar that allows admin users, or is this a groupname from the openid provider?
So I have in Pocket-ID a Main and a Special group - but adding Main and Special to traccar.xml didn't work.

But I found in pocket under the user info that it will supply "main" and "special" These seem to be the groups that the traccar.xml expects

Wondering if this information might be useful in the documentation?

Anton Tananaev 2 days ago

It's OpenID group, not Traccar. Traccar doesn't have user groups at all.