HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Social SignIn and usernames

K17K17 Français / French Paris, France ✭✭✭

Is there a way to let users choose their usernames after registering with social services such as Google ?

Today, if a user register to my forum using their username Vanilla will only let him to use his First and Last name that he entered in google account.

And worse: if I change the username, Vanillla will set it as the "Google" name on the next time the user log in.

Why ?


  • R_JR_J Ex-Fanboy Munich Admin

    If we are talking about the Google sign in, the reason simply is that there are connections made between the information Vanilla requires and the data Google sends and the name is linked:

               // Translate claims coming back from Google.
               $this->provider['ProfileKeyName'] = self::PROFILE_NAME;

    Not sure what your requirements are, but the Google plugin is only a preconfigured version of the OAuth2 plugin which allows more user configuration. I surely cannot predict what would happen if the user name field is not linked when setting up the OAuth2 plugin, but you might want to get that a try. Or be brave and comment out the line above from the Google plugin.

  • K17K17 Français / French Paris, France ✭✭✭

    Okay thanks ^^

    It's just a really akward behaviour. When I want to log in with m'y Google account on a forum, I don't want my user name to be my first and last name ^^ that's a really weird setup.

  • R_JR_J Ex-Fanboy Munich Admin

    Signing in with a special identity and being shown as that identity could also be seen as expected behaviour, if you ask me.

    But I agree that it would be better to be able to choose your username. In some serious hobbyist forum it might be okay to find yourself as "Firstname Lastname" but in some other places you might want to have the comfort of SSO together with a cool nickname

  • K17K17 Français / French Paris, France ✭✭✭

    Yes, it's most because of the firstname/lastname that I find this wierd.

    SSO plugins should take care of this, if the provider do not provide actual usernames but full identity. Something that must be kept private in most circumstances.

  • Since there is an option for that in the Facebook plugin (Plugins.Facebook.UseFacebookNames), adding a config option like this to the Google plugin would be a sensible request.

  • K17K17 Français / French Paris, France ✭✭✭

    Oh I haven't seen that. I'll take a look at it I'm doing a feedback.

  • K17K17 Français / French Paris, France ✭✭✭
    edited February 2021

    @R_J Actually, I did comment out that line and Vanilla just asks to choose a username if there is no user with this email registered. Have to figure out what happens if the email is used.

    Maybe like for jsConnect, asking the user to login.

Sign In or Register to comment.