UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

27 lines 1.84 kB
import { AuthenticationRequest, AuthenticationResponse } from '@sage-bionetworks/aridhia-client/generated/models'; import { Configuration } from '@sage-bionetworks/aridhia-client/generated/runtime'; /** * Exchanges a Synapse access token for an Aridhia access token. * Note: Aridhia tokens can only be used once, so a fresh token should be obtained for each API call. * * @param synapseAccessToken - The Synapse access token to exchange * @param apiBasePath - Base URL for the Aridhia Gateway API * @param authenticationRequest - Authentication request parameters (excluding subject_token) * @returns The authentication response containing the Aridhia access token * @throws Error if the token exchange fails or no access token is returned */ export declare function exchangeSynapseTokenForAridhia(synapseAccessToken: string, apiBasePath: string, authenticationRequest: Omit<AuthenticationRequest, 'subject_token'>): Promise<AuthenticationResponse>; /** * Creates an Aridhia API Configuration object with a freshly exchanged access token. * This is a convenience function for creating API instances. * * All API calls should go through the gateway. For FAIR API calls, use the path: * https://gateway.../fair/<api path> * * @param synapseAccessToken - The Synapse access token to exchange * @param gatewayBasePath - Base URL for the Aridhia Gateway API (used for both authentication and API calls) * @param authenticationRequest - Authentication request parameters (excluding subject_token) * @returns A Configuration object ready to use with Aridhia API clients */ export declare function createAridhiaApiConfiguration(synapseAccessToken: string, gatewayBasePath: string, authenticationRequest: Omit<AuthenticationRequest, 'subject_token'>): Promise<Configuration>; //# sourceMappingURL=aridhiaTokenExchange.d.ts.map