alexziskind1 / nativescript-oauth

Other
35 stars 53 forks source link

Using UAA to login with instagram #52

Open gemins opened 7 years ago

gemins commented 7 years ago

I trying to connect with instagram using UAA, but the system not read the CODE received. Is some information to understand how work this method (UAA) or some example?.

var uaaInitOptions: tnsOAuthModule.ITnsOAuthOptionsUaa = { authority: 'https://www.instagram.com', redirectUri: 'https://www.facebook.com/connect/login_success.html', clientId: 'xxxxxxxxxxxxxxx', clientSecret: '', scope: ['public_content', 'follower_list'], cookieDomains: [".facebook.com"], basicAuthHeader: "Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; tnsOAuthModule.initUaa(uaaInitOptions);

I used this config to get the information and use the facebook's callback because it is more easy, but i can use my API to show some code, but the app pass the login (instagram) stage and was freezing in white page, not return to the app and nothing more is happen.

Thanks you.

gemins commented 7 years ago

I find the solution, but need change in the package.

Changing auth-helper-uaa.js file in line 24, the option "tokenEndpoint". if this option were editable can be the final solution to login with Instagram and may be with another social media too.

stephan-fischer commented 6 years ago

@gemins do you have a solution? What i have to change on the option "tokenEndpoint"? Can i use localhost or etc, for the "redirectUri"?

Thank you!

gemins commented 6 years ago

Hello @stephan-fischer, i dont remember all, because is a old implementation. But, basically the changes was made on the original files (on node_modules folder). Change this var tokenEndpoint on the file auth-helper-uaa.js, with this method can change one directive need instagram to connect to the api. I hope this help you. If cant change, tell me again and try to see the old project. See you!

stephan-fischer commented 6 years ago

hi @gemins oh it works now - with: tokenEndpoint: '/oauth/access_token',

I use the facebook config as you, this is ok and good or? And another question: basicAuthHeader: "Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" is it needed to replace the xxx with something?

Thank you :)