• Resolved Denis Pintilie

    (@denisflorin197)


    Hello,

    I was not able to find anywhere if it’s possible to allow multiple google domains when configuring the plugin on a single site domain. For example, I have the google auth configured for the domain example.com and I want to allow somehow other domains that I own like exmpl.com, domain.com and test.com.

    Is it possible?

    I found this https://nextendweb.com/nextend-social-login-docs/backend-developer/ but I’m not sure if this solution ‘Prevent registration with certain email domain’ is related to the goal I want to achieve.

    Thank you,

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Robert

    (@robertnextendweb)

    Hi @denisflorin197!

    Do you mean you want to allow login/registration with only a certain group of domains? If so, then the code you found in our documentation:
    https://nextendweb.com/nextend-social-login-docs/backend-developer#prevent-registration
    Is a great start. Please note that we cannot provide support for custom coding, but basically you just need to reverse the logic there, so instead of disabling the registration with certain domains, you allow the registration with certain domains.

    If this is not what you mean, then could you please provide more information about the exact use case?

    Thread Starter Denis Pintilie

    (@denisflorin197)

    Hi @robertnextendweb,

    Exactly! I just want only a group of google domains to be able register/login on the website.

    Best,

    Plugin Support Robert

    (@robertnextendweb)

    In this case, as I mentioned you just need to reverse the logic of that code in the documentation, so if the email domain matches with one in the array, you return the data, otherwise you add the error, and then people registering with domains that are not in this whitelist won’t be able to, and will instead see the error.

    Thread Starter Denis Pintilie

    (@denisflorin197)

    Do I need to do anything when setting up the social to recognize these domains in Google App?

    Plugin Support Robert

    (@robertnextendweb)

    You don’t need to. If the emails are considered to be Google emails, so you are able to log in to Google with them, then everything should work. Otherwise you won’t be able to authenticate, since that email does not exist on the end of Google.

    Thread Starter Denis Pintilie

    (@denisflorin197)

    Thanks!

    One more question, I see that the filter in documentation is only for registration. Should I do anything else for the login?

    Best regards

    Plugin Support Robert

    (@robertnextendweb)

    No problem!

    Here is how our login/register flow works:
    If you log in with a social media that has the same email address as the email address of a WordPress user, then we will log you in to this WordPress account. Otherwise a new account will be created from the data returned by the provider.

    If you make that change, users that have “banned” emails will still be able to log in to those accounts on your website, but if you delete them manually they will need to create a new account as well. And of course the registration code would prevent them from registering. Making this limitation for login as well does not make much sense, since at the point you could just delete the accounts with banned emails as they wouldn’t be able to log in anyway.

    Thread Starter Denis Pintilie

    (@denisflorin197)

    Hello,

    I tried to apply a solution and I see this error: error 403 org_internal.

    Do you know what is causing this problem?

    Best,

    Plugin Support Robert

    (@robertnextendweb)

    That usually happens when the “User Type” is set to “Internal” in your Google App. Internal apps can only be used by members of the organization, so others won’t be able to use it. So make sure that the User Type is set to “External”.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Multiple domains for google auth when register/login’ is closed to new replies.