import type { AxiosRequestConfig } from 'axios'; import type { Logger } from '@sap-ux/logger'; import type { ServiceInfo } from '@sap-ux/btp-utils'; import { Redirect } from './redirect'; export type RefreshTokenChanged = (refreshToken?: string, accessToken?: string) => void | Promise; /** * A class representing interactions with an SAP BTP UAA service */ export declare class Uaa { protected log: Logger; protected readonly serviceInfo: ServiceInfo; /** * @param serviceInfo service Information * @param log logger */ constructor(serviceInfo: ServiceInfo, log: Logger); /** * @param property property * @param errMsg error message */ protected validatePropertyExists(property: string, errMsg: string): void; /** * Getter for uaa url. * * @returns uaa url */ protected get url(): string; /** * Getter for client id. * * @returns client id */ protected get clientid(): string; /** * Getter for client secret. * * @returns client secret */ protected get clientsecret(): string; /** * Getter for logout url. * * @returns logout url */ protected get logoutUrl(): string; /** * Getter for system id. * * @returns system id */ protected get systemId(): string; /** * Getter for username. * * @returns system id */ private get username(); /** * Getter for password. * * @returns system id */ private get password(); /** * Generates a request url based on the provided redirect url. * * @param params config parameters * @param params.redirectUri redirect url * @returns authentication code request url */ protected getAuthCodeUrl({ redirectUri }: { redirectUri: any; }): string; /** * Generate an access token using grant_type password to the authorization service (XSUAA). * * @returns an axios request config */ protected getTokenRequestForClientCredential(): AxiosRequestConfig; /** * Generate an Axios token request configuration for fetching a token. * * @param params config parameters * @param params.redirectUri redirect url * @param params.authCode authentication code * @returns an axios request config */ protected getTokenRequestForAuthCode({ redirectUri, authCode }: { redirectUri: any; authCode: any; }): AxiosRequestConfig; /** * Generate an Axios token request configuration for fetching a token. * * @param refreshToken existing refresh token * @returns an axios request config */ protected getTokenRequestForRefreshToken(refreshToken: any): AxiosRequestConfig; /** * Get user information. * * @param accessToken valid access token * @returns user name or undefined */ getUserInfo(accessToken: string): Promise; /** * Get an authentication code. * * @param timeout timeout * @returns an object containing an authentication code and a redirect object */ protected getAuthCode(timeout?: number): Promise<{ authCode: string; redirect: Redirect; }>; /** * @param refreshToken refreshToken * @param refreshTokenChangedCb refreshTokenChanged callback function * @returns an access token. */ getAccessToken(refreshToken?: string, refreshTokenChangedCb?: RefreshTokenChanged): Promise; /** * Retrieve an access token using the client credentials. * * @returns an access token using the BTP UAA credentials */ getAccessTokenWithClientCredentials(): Promise; } //# sourceMappingURL=uaa.d.ts.map