Search code examples
google-oauth

Attaching additional info to a Google user


Is it possible to add additional info to a Google user, during creation, on a Google Domain?

We have a range of users, that we identify by their email ("[email protected]"). Some of the users gets to pick a new email, like with their initials, instead of the autogenerated username.

This causes a issue, since we are using a webservice (that we have no controll over), this webservice provides only the users real name, and then their autogenerated username, but not "custom" email with for example the users initials.

So when the user from google comes with his login info, I cant match that user with the userdata from the webservice.

If it was possible to attach the autogenerated username to the google user, it could be matched that way. But i havent been able to find anything about adding custom info like this, to a Google Domain user.


Solution

  • We solved this issue, by adding an alternative email with the autogenerated username + google domain on creation of the Google user.

    We then checked the email of the user trying to log in, and if it didnt match, we then checked his alternative email for matches.