forked from alexziskind1/nativescript-oauth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth-helper-facebook.ts
26 lines (23 loc) · 925 Bytes
/
auth-helper-facebook.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import * as tnsOauth from './tns-oauth';
import { AuthHelper } from './auth-helper';
import * as TnsOAuth from './tns-oauth-interfaces';
export class AuthHelperFacebook extends AuthHelper implements TnsOAuth.ITnsAuthHelper {
constructor(clientId: string, clientSecret: string, scope: Array<string>) {
super();
var scopeStr = scope.join('%20');
this.credentials = {
authority: 'https://www.facebook.com/dialog',
tokenEndpointBase: 'https://graph.facebook.com',
authorizeEndpoint: '/oauth',
tokenEndpoint: '/v2.3/oauth/access_token',
clientId: clientId,
clientSecret: clientSecret,
redirectUri: 'https://www.facebook.com/connect/login_success.html',
scope: scopeStr
};
}
public logout(successPage?: string): Promise<void> {
let cookieDomains = [".facebook.com"]; //need to double check this
return this._logout(successPage, cookieDomains);
}
}