ngx-cordova-oauth icon indicating copy to clipboard operation
ngx-cordova-oauth copied to clipboard

Cannot authenticate via web Browser

Open victjam opened this issue 7 years ago • 1 comments

I just follow the examples and when compile the app to my phone(android) and click login it says that. Somebody can help me? or tell me what is the right configuration in the facebook console.

my register component look like this.

import { Component, OnInit } from '@angular/core'; import { Facebook, Google, LinkedIn } from 'ng2-cordova-oauth/core'; import { OauthCordova } from 'ng2-cordova-oauth/platform/cordova';

@Component({ selector: 'app-register', templateUrl: './register.component.html', styleUrls: ['./register.component.scss'] }) export class RegisterComponent implements OnInit { private oauth: OauthCordova = new OauthCordova(); private facebookProvider: Facebook = new Facebook({ clientId: '**********', appScope: ['email'] }); constructor() {}

ngOnInit() {}

login() { this.oauth.logInVia(this.facebookProvider).then( success => { alert('RESULT: ' + JSON.stringify(success)); }, error => { alert('ERROR: ' + error); } ); } }

my register.html like this

<div class="network col-12"> <button (click)="login()" class="btn btn-primary connect">Sign Up With Facebook</button> </div>

victjam avatar May 23 '18 03:05 victjam

You need to use class OauthBrowser (located in ng2-cordova-oauth/platform/browser) instead of OauthCordova.

brunobastosg avatar Jul 05 '18 18:07 brunobastosg