Integration of instagram authentication in android

I am creating an Android application that uses instagram APIs, and I would like to know if there is a solution that avoids creating an api (redirect uri) to handle redirection from the instragram checkpoint to look for tokens for the android client.

+4
source share
1 answer

I think you can do this with client (implicit) authentication . Check out the section at the end of the article.

, Instagram redirect_uri access_token url. :

http://your-redirect-uri#access_token=ACCESS-TOKEN

access_token URL-, . , .

, , uri, . , www.google.com uri, ,

http://www.google.com#access_token=ACCESS-TOKEN

. URI, .

WebView, , , shouldOverrideUrlLoading() ( WebViewClient):

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if (url.startsWith("http://www.google.com") { // redirect uri!
        String accessToken = ... // get token from url
        return true; // don’t load the page
    }
    return false;
}

, , , , , .

+4

Source: https://habr.com/ru/post/1663037/


All Articles