Auth0 Home Blog Docs

Google Plus Login

android
google
login

#1

I’m using social login to access my Android app. To login with Facebook I’m using:

Auth0 auth0 = new Auth0(getString(R.string.auth0_client_id), getString(R.string.auth0_domain));
WebAuthProvider.init(auth0)
    .withConnection("facebook")
    .start(LoginActivity.this, new AuthCallback() {
        @Override
        public void onFailure(@NonNull Dialog dialog) {
            …
        }
        @Override
        public void onFailure(AuthenticationException exception) {
            …
        }
        @Override
        public void onSuccess(@NonNull Credentials credentials) {
            …
        }
});

and it’s working fine. Is there a way to do something similar to login using Google+? I’ve tried using withConnection("google") and withConnection("googleplus"), but it doesn’t work…

I do not want to use Lock.


#2

Found the answer! It works when I use withConnection("google-oauth2").


#3