alexziskind1 / nativescript-oauth2

Other
86 stars 93 forks source link

LinkedIn provider getting http 500 on requesting access_token with auth_code #96

Open sandeepbalouria opened 4 years ago

sandeepbalouria commented 4 years ago

import {configureTnsOAuth, TnsOAuthClient} from 'nativescript-oauth2'; import {TnsOaProviderLinkedIn} from 'nativescript-oauth2/providers';

let client = null;

const configureTnsOAuthProviderLinkedIn = () => { let options = { openIdSupport: "oid-none", clientId: "uu", clientSecret: "mh", redirectUri: "https://www.linkedin.com", scopes: ["r_emailaddress"] };

return new TnsOaProviderLinkedIn(options); };

export const configureOAuthProviders = () => { configureTnsOAuth([configureTnsOAuthProviderLinkedIn(),]); };

export const tnsOAuthLogin = providerType => { client = new TnsOAuthClient(providerType); client.loginWithCompletion((tokenResult, err) => { if(err) { console.log('Something went wrong with login' + err); }else { console.log(tokenResult); } }); };

export const tnsOAuthLogout = () => { if(client) { client.logout(); } };

CONSOLE ERROR file:///node_modules/nativescript-oauth2/tns-oauth-login-sub-controller.js:68:34: 500 ERROR Occurred CONSOLE LOG file:///app/services/auth-service.js:26:18: 'Something went wrong with loginError: 500 ERROR Occurred'

My Linkedin Oauth works on Auth0 but not through nativescript vue

sandeepbalouria commented 4 years ago

I added Facebook Oauth flow to my app. It is working fine.

const configureOAuthProviderFacebook = () => { let options = { openIdSupport: "oid-none", clientId: "2777", clientSecret: "9fee2", redirectUri: "https://www.facebook.com/connect/login_success.html", scopes: ["email"] };

return new TnsOaProviderFacebook(options); };