Facebook login without sdk

I want to authenticate the user via Facebook after the oauth2 stream.

I want to do this without using the SDK. But I can not understand what are the endpoints for user authentication.

Where can I find them?

Change This is in a mobile application. IOS or Android.

+5
source share
2 answers

Here is my login for Android (Java).

APP_ID = "XXXXXXXXXXXXXXXX" RAW_REDIRECT_URI = "https://www.facebook.com/connect/login_success.html"; // UTF8 adress so it can go along the http request REDIRECT_URI =""; try { REDIRECT_URI = URLEncoder.encode(RAW_REDIRECT_URI, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } // get the code or token TOKEN_REQUEST = "https://www.facebook.com/v3.2/dialog/oauth?client_id="+APP_ID+"&redirect_uri="+REDIRECT_URI+ "&state=\'{st=state123abc,ds=123456789}\'"; // start WebView webView.setWebViewClient(new WebViewClient() { // shouldOverride will run each time a new URL is loaded in the webview. @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // the loaded URL is our redirect URL if(url.startsWith(RAW_REDIRECT_URI)) { // here you have two choices... // - make a call to your private server to get the token from the code (recommended) // - make the API requests because you added a response_type=token in the TOKEN_REQUEST (less secure ) } return false; } }); // javascript doesn't seem to be needed for facebook but for instagram yes. webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl(TOKEN_REQUEST); 
0
source

All Articles