@acceleratxr/core_sdk / OAuthService

Class: OAuthService#

The OAuthService provides an API for implementing OAuth 2.0 compatible single-sign on between an XBE cluster and third party applications.

author Jean-Philippe Steinmetz info@acceleratxr.com

Hierarchy#

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new OAuthService(apiClient: ApiClient, config: Configuration): OAuthService

Overrides ServiceBase.constructor

Defined in src/services/OAuthService.ts:15

Parameters:#

Name

Type

apiClient

ApiClient

config

Configuration

Returns: OAuthService

Properties#

apiClient#

Protected apiClient: ApiClient

Inherited from ServiceBase.apiClient

Defined in src/ServiceBase.ts:14

The API Client used when making requests to the API backend server.


config#

Protected config: Configuration

Inherited from ServiceBase.config

Defined in src/ServiceBase.ts:19

The SDK configuration to use.


uuid#

Static uuid: string = “21cd7e58-88b5-4e63-b10a-8ec7d1fef73d”

Defined in src/services/OAuthService.ts:21

Methods#

authorize#

authorize(clientID: string, responseType: string | string[], redirectURI: string, scope: string | string[], codeChallenge?: undefined | string, codeChallengeMethod?: undefined | string, state?: undefined | string): Promise<string>

Defined in src/services/OAuthService.ts:28

Requests an authorization token for the OAuth 2.0 application with the specified parameters. This function returns the redirect URL containing the authorization token. Upon return, the implementing client should automatically redirect the browser to the returned URL to complete the process.

Parameters:#

Name

Type

clientID

string

responseType

string | string[]

redirectURI

string

scope

string | string[]

codeChallenge?

undefined | string

codeChallengeMethod?

undefined | string

state?

undefined | string

Returns: Promise<string>


getAccessToken#

getAccessToken(code: string, clientID: string, clientSecret: string, redirectURI: string, codeVerifier?: undefined | string): Promise<any>

Defined in src/services/OAuthService.ts:98

Requests an access token for the specified OAuth 2.0 authorization token and application configuration.

Parameters:#

Name

Type

code

string

clientID

string

clientSecret

string

redirectURI

string

codeVerifier?

undefined | string

Returns: Promise<any>


getAuthorizationURL#

getAuthorizationURL(clientID: string, responseType: string | string[], redirectURI: string, scope: string | string[], codeChallenge?: undefined | string, codeChallengeMethod?: undefined | string, state?: undefined | string): Promise<string>

Defined in src/services/OAuthService.ts:61

Retrieves the authorization URL for the OAuth 2.0 application with the specified parameters.

Parameters:#

Name

Type

clientID

string

responseType

string | string[]

redirectURI

string

scope

string | string[]

codeChallenge?

undefined | string

codeChallengeMethod?

undefined | string

state?

undefined | string

Returns: Promise<string>