Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use hostedDomain option? #277

Closed
Robo-Rin opened this issue Aug 17, 2017 · 3 comments
Closed

How to use hostedDomain option? #277

Robo-Rin opened this issue Aug 17, 2017 · 3 comments
Labels

Comments

@Robo-Rin
Copy link

I'm a little unclear what this does and how to use it. I tried:

GoogleSignin.configure({
	webClientId: '[...].apps.googleusercontent.com',
	hostedDomain: 'somedomain.com'
});

but it doesn't seem to do anything.

Am I able to restrict which email domains can log in with this? Thanks!

I mentioned this in my StackOverflow question here.

@Robo-Rin
Copy link
Author

I've figured out that it excludes the login from subsequent login attempts for email addresses that do not match the hostedDomain (somedomain.com), but it doesn't seem to prevent the initial login in the first place.

Is preventing the initial login of email addresses that don't match the specified hostedDomain possible out of box?

@AndreiCalazans
Copy link
Collaborator

According to google docs you need to verify in the client as well.
https://developers.google.com/identity/sign-in/web/reference#gapiauth2clientconfig

So check if the user logged in is from the correct hostedDomain if not log him out. Then he should be prompt again to choose a different email.

Please re-open this issue if this is still a problem.

@meta-utkarsh-ahuja
Copy link

When a user enters its username manualy and it is not of correct doamin than can we login again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants