-
Notifications
You must be signed in to change notification settings - Fork 53
/
auth-helper-linkedin.ts
31 lines (29 loc) · 1.05 KB
/
auth-helper-linkedin.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
27
28
29
30
31
/// <reference path="references.d.ts" />
import * as tnsOauth from './tns-oauth';
import { AuthHelper } from './auth-helper';
import * as TnsOAuth from './tns-oauth-interfaces';
/**
Contains LinkedIn connection credentials
*/
export class AuthHelperLinkedIn extends AuthHelper implements TnsOAuth.ITnsAuthHelper {
//Constructs the the object with specified id, secret and scope
constructor(clientId: string, clientSecret: string, redirectUri: string, scope: Array<string>) {
super();
var scopeStr = scope.join('%20');
this.credentials = {
authority: 'https://www.linkedin.com',
tokenEndpointBase: 'https://www.linkedin.com',
authorizeEndpoint: '/oauth/v2/authorization',
tokenEndpoint: '/oauth/v2/accessToken',
clientId: clientId,
clientSecret: clientSecret,
redirectUri: redirectUri,
scope: scopeStr
};
}
//Gets cookie domains for logging out
public logout(successPage?: string): Promise<void> {
let cookieDomains = [".linkedin.com"];
return this._logout(successPage, cookieDomains);
}
}