-
Notifications
You must be signed in to change notification settings - Fork 53
/
auth-helper-uaa.ts
35 lines (27 loc) · 1.07 KB
/
auth-helper-uaa.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
32
33
34
/// <reference path="references.d.ts" />
import * as tnsOauth from './tns-oauth';
import { AuthHelper } from './auth-helper';
import * as TnsOAuth from './tns-oauth-interfaces';
export class AuthHelperUaa extends AuthHelper implements TnsOAuth.ITnsAuthHelper {
private _cookieDomains: string[];
constructor(authority: string, redirectUri: string, clientId: string, clientSecret: string, scope: Array<string>, cookieDomains: Array<string>, basicAuthHeader: string) {
super();
var scopeStr = scope.join('%20');
let uaaCreds: TnsOAuth.ITnsOAuthCredentialsUaa = {
authority: authority,
authorizeEndpoint: '/oauth/authorize',
tokenEndpoint: '/oauth/token',
clientId: clientId,
clientSecret: clientSecret,
redirectUri: redirectUri,
scope: scopeStr,
basicAuthHeader: basicAuthHeader
};
this.credentials = uaaCreds;
this._cookieDomains = cookieDomains;
}
public logout(successPage?: string): Promise<void> {
let cookieDomains = this._cookieDomains;
return this._logout(successPage, cookieDomains);
}
}