@openfin/servicenow
Version:
Connect OpenFin Container with ServiceNow
18 lines (17 loc) • 1.51 kB
TypeScript
import { AuthFlowParams, AuthWindowOptions } from '@openfin/oauth';
import { ServiceNowConnection } from './connection.types';
/**
* Initiates the OAuth 2.0 authorization code flow and establishes a connection with a ServiceNow instance.
*
* @param instanceUrl - The URL of the ServiceNow instance.
* @param clientId - The ID of the registered OAuth application to use for authorization.
* @param scope - Provide any additional REST API {@link https://docs.servicenow.com/bundle/utah-platform-security/page/administer/security/concept/rest-api-auth-scope.html | Auth Scopes} that may be required by your app.
* @param authFlowParams - Optionally modify the {@link https://docs.servicenow.com/bundle/utah-platform-security/page/administer/security/concept/c_OAuthAuthorizationCodeFlow.html | authorization process} by providing additional parameters.
* @param authWindowOptions - Optionally change the appearance and behavior of the authorization popup window by specifying additional options.
*
* @returns A {@link ServiceNowConnection | connection} which can be used to execute REST API requests against the instance.
*
* @throws {@link AuthorizationError} if the authorization process does not complete successfully.
* @throws {@link ParameterError} if invalid function parameter values are detected.
*/
export declare const connect: (instanceUrl: string, clientId: string, scope?: string[], authFlowParams?: AuthFlowParams, authWindowOptions?: AuthWindowOptions) => Promise<ServiceNowConnection>;