-
Notifications
You must be signed in to change notification settings - Fork 539
/
keycloak.d.ts
59 lines (50 loc) · 1.63 KB
/
keycloak.d.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
declare module KeycloakModule {
export interface Promise {
success(callback: Function): Promise;
error(callback: Function): Promise;
}
export interface InitOptions {
checkLoginIframe?: boolean;
checkLoginIframeInterval?: number;
onLoad?: string;
}
export interface LoginOptions {
prompt?: String;
loginHint?: String;
}
export interface RedirectUriOptions {
redirectUri?: String;
}
export interface IKeycloak {
init(options?: InitOptions): Promise;
login(options?: LoginOptions): Promise;
createLoginUrl(options?: LoginOptions): string;
logout(options?: RedirectUriOptions): Promise;
createLogoutUrl(options?: RedirectUriOptions): string;
createAccountUrl(options?: RedirectUriOptions): string;
accountManagement(): Promise;
hasRealmRole(role: string): boolean;
hasResourceRole(role: string, resource?: string): boolean;
loadUserProfile(): Promise;
isTokenExpired(minValidity: number): boolean;
updateToken(minValidity: number): Promise;
realm: string;
clientId: string;
authServerUrl: string;
token: string;
tokenParsed: any;
refreshToken: string;
refreshTokenParsed: any;
idToken: string;
authenticated: boolean;
subject: string;
onAuthSuccess: Function;
onAuthError: Function;
onAuthRefreshSuccess: Function;
onAuthRefreshError: Function;
onAuthLogout: Function;
}
}
declare var Keycloak: {
new(config?: any): KeycloakModule.IKeycloak;
};