@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
49 lines • 3.97 kB
TypeScript
import { XsuaaServiceCredentials } from '../environment-accessor-types';
import { ResilienceOptions } from '../resilience-options';
import { ClientCredentials, ClientCredentialsResponse, UserTokenResponse } from '../xsuaa-service-types';
/**
* @deprecated Since v1.49.0 Use `@sap/xssec` lib instead.
* Executes a client credentials grant request.
* If the first parameter is an instance of [[XsuaaServiceCredentials]], the response's access_token will be verified.
* If the first parameter is a URI, the response will not be verified.
* @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
* @param clientCredentials - Client credentials for which to request a token.
* @param options - Options to use by retrieving access token.
* @param customBody - Object containing value required for the body request.
* @returns A promise resolving to the response.
*/
export declare function clientCredentialsGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, clientCredentials: ClientCredentials, options?: ResilienceOptions, customBody?: Record<string, any>): Promise<ClientCredentialsResponse>;
/**
* @deprecated Since v1.41.0 Use [[jwtBearerTokenGrant]] instead.
* Executes a user token grant request against the given URI.
* @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
* @param userJwt - The JWT of the user on whose behalf the request is executed.
* @param clientId - The client_id of the target XSUAA service instance.
* @param options - Options to use by retrieving access token
* @returns A promise resolving to the response of the XSUAA service.
*/
export declare function userTokenGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, userJwt: string, clientId: string, options?: ResilienceOptions): Promise<UserTokenResponse>;
/**
* @deprecated Since v1.41.0 Use [[jwtBearerTokenGrant]] instead.
* Executes a refresh token grant request against the given URI.
* If the first parameter is an instance of [[XsuaaServiceCredentials]], the response's access_token will be verified.
* If the first parameter is an URI, the response will not be verified.
* @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
* @param clientCredentials - The credentials (client_id, client_secret) of the target XSUAA service instance.
* @param refreshToken - The refresh token that should be used to generate a new access token.
* @param options - Options to use by retrieving access token.
* @returns A promise resolving to the response of the XSUAA service.
*/
export declare function refreshTokenGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, clientCredentials: ClientCredentials, refreshToken: string, options?: ResilienceOptions): Promise<UserTokenResponse>;
/**
* @deprecated Since v1.49.0 Use `@sap/xssec` lib instead.
* Executes a JWT bearer token grant request against the given URI.
* @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
* @param clientCredentials - The credentials (client_id, client_secret) of the target XSUAA service instance.
* @param userJwt - The JWT of the user on whose behalf the request is executed.
* @param options - Options to use by retrieving access token.
* @returns A promise resolving to the response of the XSUAA service.
*/
export declare function jwtBearerTokenGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, clientCredentials: ClientCredentials, userJwt: string, options?: ResilienceOptions): Promise<ClientCredentialsResponse>;
export declare function headerForClientCredentials(clientCredentials: ClientCredentials): string;
//# sourceMappingURL=xsuaa-service.d.ts.map