search-client
Version:
Javascript library for executing searches in the Haive search-index via the SearchManager REST interface.
42 lines (41 loc) • 2.2 kB
TypeScript
import { BaseCall, Fetch, Query } from '../Common';
import { IAuthentication } from './Authentication';
import { IAuthenticationSettings } from './AuthenticationSettings';
import { AuthToken } from './AuthToken';
/**
* The OidcAuthentication service is a supporting feature for the other services.
* Typically used via the [[SearchClient.constructor]] and by providing [[AuthenticationSettings]] settings in
* the [[Settings.authentication]] property.
*
* The authentication system is based on OpenId Connect and needs an end-point to be configured supporting full
* oidc flows. This service will be monitoring the token-value to see if it is either missing or
* expired. When that happens a new token will be fetched from the oidc end-point.
*/
export declare class OidcAuthentication extends BaseCall<any> implements IAuthentication {
static handleSilentSignin(responseMode: string): void;
static handleSigninRedirect(responseMode: string, callback: (state: any) => any): void;
settings: IAuthenticationSettings;
private user;
private oidcSettings;
/**
* Creates an OidcAuthentication object that knows where to get the auth-token and when to refresh it.
* @param settings - The settings for the authentication object.
* @param auth - An object that controls the authentication for the lookups.
*/
constructor(settings: IAuthenticationSettings | string, auth?: AuthToken, fetchMethod?: Fetch);
/**
* Call the service, but take into account deferredUpdates.
*
* @param query The query object to create the fetch for.
* @param delay A delay for when to execute the update, in milliseconds. Defaults to undefined.
*/
update(query: Query, delay?: number): void;
/**
* Fetches the authentication-token from the oidc server.
* @param query - For the Authentication service this parameter is ignored.
* @param suppressCallbacks - Set to true if you have defined callbacks, but somehow don't want them to be called.
* @returns a promise that when resolved returns a jwt token.
*/
protected fetchInternal(query?: Query, suppressCallbacks?: boolean): Promise<string>;
private login;
}