Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot authenticate via web Browser #75

Open
victjam opened this issue May 23, 2018 · 1 comment
Open

Cannot authenticate via web Browser #75

victjam opened this issue May 23, 2018 · 1 comment

Comments

@victjam
Copy link

victjam commented May 23, 2018

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>

@brunobastosg
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants