Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Android: Restrict Google Sign In to certain emails with domain
private void handleSignInResult(GoogleSignInResult result) {
Log.d(TAG, "handleSignInResult:" + result.isSuccess());
if (result.isSuccess()) {
// Signed in successfully.
GoogleSignInAccount acct = result.getSignInAccount();
String email = acct.getEmail();
String[] split = s.split("@");
String domain = split[1]; //This Will Give You The Domain After '@'
//Proceed Ahead.
//Show User Warning UI.
} else {
// Signed out, show unauthenticated UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.