UNPKG

3.97 kBTypeScriptView Raw
1import { XsuaaServiceCredentials } from '../environment-accessor-types';
2import { ResilienceOptions } from '../resilience-options';
3import { ClientCredentials, ClientCredentialsResponse, UserTokenResponse } from '../xsuaa-service-types';
4/**
5 * @deprecated Since v1.49.0 Use `@sap/xssec` lib instead.
6 * Executes a client credentials grant request.
7 * If the first parameter is an instance of [[XsuaaServiceCredentials]], the response's access_token will be verified.
8 * If the first parameter is a URI, the response will not be verified.
9 * @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
10 * @param clientCredentials - Client credentials for which to request a token.
11 * @param options - Options to use by retrieving access token.
12 * @param customBody - Object containing value required for the body request.
13 * @returns A promise resolving to the response.
14 */
15export declare function clientCredentialsGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, clientCredentials: ClientCredentials, options?: ResilienceOptions, customBody?: Record<string, any>): Promise<ClientCredentialsResponse>;
16/**
17 * @deprecated Since v1.41.0 Use [[jwtBearerTokenGrant]] instead.
18 * Executes a user token grant request against the given URI.
19 * @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
20 * @param userJwt - The JWT of the user on whose behalf the request is executed.
21 * @param clientId - The client_id of the target XSUAA service instance.
22 * @param options - Options to use by retrieving access token
23 * @returns A promise resolving to the response of the XSUAA service.
24 */
25export declare function userTokenGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, userJwt: string, clientId: string, options?: ResilienceOptions): Promise<UserTokenResponse>;
26/**
27 * @deprecated Since v1.41.0 Use [[jwtBearerTokenGrant]] instead.
28 * Executes a refresh token grant request against the given URI.
29 * If the first parameter is an instance of [[XsuaaServiceCredentials]], the response's access_token will be verified.
30 * If the first parameter is an URI, the response will not be verified.
31 * @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
32 * @param clientCredentials - The credentials (client_id, client_secret) of the target XSUAA service instance.
33 * @param refreshToken - The refresh token that should be used to generate a new access token.
34 * @param options - Options to use by retrieving access token.
35 * @returns A promise resolving to the response of the XSUAA service.
36 */
37export declare function refreshTokenGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, clientCredentials: ClientCredentials, refreshToken: string, options?: ResilienceOptions): Promise<UserTokenResponse>;
38/**
39 * @deprecated Since v1.49.0 Use `@sap/xssec` lib instead.
40 * Executes a JWT bearer token grant request against the given URI.
41 * @param tokenServiceUrlOrXsuaaServiceCredentials - The URL of the token service or the credentials of a XSUAA service instance.
42 * @param clientCredentials - The credentials (client_id, client_secret) of the target XSUAA service instance.
43 * @param userJwt - The JWT of the user on whose behalf the request is executed.
44 * @param options - Options to use by retrieving access token.
45 * @returns A promise resolving to the response of the XSUAA service.
46 */
47export declare function jwtBearerTokenGrant(tokenServiceUrlOrXsuaaServiceCredentials: string | XsuaaServiceCredentials, clientCredentials: ClientCredentials, userJwt: string, options?: ResilienceOptions): Promise<ClientCredentialsResponse>;
48export declare function headerForClientCredentials(clientCredentials: ClientCredentials): string;
49//# sourceMappingURL=xsuaa-service.d.ts.map
\No newline at end of file