Auth0 Home Blog Docs

Social Login using Android SDK AuthenticationAPIClient

android-auth
android-client

#1

I am using the latest version of the Android SDK and want to implement social login using my own custom UI. When i try calling the AuthenticationAPIClient loginWithOAuthAccessToken it tries calling the “/oauth/access_token” endpoint to which i get a 404 error.

From the Auth0 API documentation I understand that the “/oauth/access_token” endpoint is a legacy one and we should be using “/authorize” endpoint for social login (https://auth0.com/docs/api/authentication#social) . I wanted to check how can we achieve this using the Android Auth0 SDK?


#2

As you mentioned the /oauth/access_token is deprecated and the recommendation is to use /authorize. The Android quickstart shows how you can accomplish this through the SDK WebAuthProvider; in particular, you should focus in the start authentication section. Have in mind that although being the recommendation it does not provide the same exact characteristics of the deprecated endpoint you mentioned.


#3

Thanks for the answer :). Our application requires a very specific look and feel and we wont be able to move to the auth0 web hosted login screen as we cannot let the user see a browser window being opened (we cant seem to find a way to hide the address bar for the web view). Is there a way to have a callback to the native app after facebook authorization?


#4

Sorry for my previous comment i got a bit confused between WebAuthProvider and the hosted auth0 login page. Your suggestion works perfectly. Thanks!