@ebondu/angular2-keycloak
Version:
90 lines (89 loc) • 3.48 kB
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
/**
* Keycloak core classes to manage tokens with a keycloak server.
*
* Used for login, logout, register, account management, profile.
* Provide Angular Observable objects for initialization, authentication, token expiration.
*
*/
export declare class KeycloakService {
#private;
initializedObs: Observable<boolean>;
initializedAuthzObs: Observable<boolean>;
authenticationObs: Observable<boolean>;
tokenExpiredObs: Observable<boolean>;
authenticationErrorObs: Observable<any>;
accessToken: string;
tokenParsed: any;
sessionId: any;
private initBS;
private initAuthzBS;
private authenticationsBS;
private tokenExpiredBS;
private authenticationErrorBS;
private refreshToken;
private refreshTokenParsed;
private rpt;
private idToken;
private idTokenParsed;
private umaConfig;
private adapter;
private callbackStorage;
private responseType;
private timeSkew;
private tokenTimeoutHandle;
private subject;
private realmAccess;
private resourceAccess;
private loginIframe;
keycloakConfig: import("../model/keycloak-config.model").KeycloakConfiguration;
readonly initOptions: import("../model/keycloak-config.model").KeycloakInitOptions;
get http(): HttpClient;
constructor();
parseCallback(url: string): any;
processCallback(oauth: any): Observable<boolean>;
login(options: any): any;
logout(options: any): any;
updateToken(minValidity: number): Observable<string>;
register(options: any): any;
accountManagement(options: any): any;
loadChangePassword(options: any): any;
loadUserProfile(): Observable<any>;
updateUserProfile(profile: any): Observable<any>;
createDeleteAccountUrl(options?: any): string;
createUpdateProfileUrl(options?: any): string;
changePassword(): string;
loadUserInfo(): Observable<any>;
hasRealmRole(role: string): boolean;
hasResourceRole(role: string, resource: string): boolean;
isTokenExpired(minValidity: number): boolean;
isRefreshTokenExpired(minValidity: number): boolean;
/**
* This method enables client applications to better integrate with resource servers protected by a Keycloak
* policy enforcer.
*
* In this case, the resource server will respond with a 401 status code and a WWW-Authenticate header holding the
* necessary information to ask a Keycloak server for authorization data using both UMA and Entitlement protocol,
* depending on how the policy enforcer at the resource server was configured.
*/
authorize(wwwAuthenticateHeader: string): Observable<string>;
/**
* Obtains all entitlements from a Keycloak Server based on a give resourceServerId.
*/
entitlement(resourceServerId: string): Observable<boolean>;
clearToken(initOptions: any): void;
createLoginUrl(options: any): string;
createLogoutUrl(options: any): string;
createRegisterUrl(options: any): string;
createAccountUrl(options: any): string;
createChangePasswordUrl(options: any): string;
getRealmUrl(): string;
private initService;
private processAuthz;
private authSuccess;
private setToken;
static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakService>;
}