Skip to main content

lightyear.oauthconnector

Home > @runlightyear/lightyear > OAuthConnector

OAuthConnector class

OAuth2 Connector

Creates the input to the 3 essential OAuth tasks:

  1. Generates a url to request an access token 2. Converts the oauth callback parameters into the https call to request an access token 3. Provides the https params to refresh an access token
Signature:
declare abstract class OAuthConnector 

Constructors

ConstructorModifiersDescription
(constructor)(props)Constructs a new instance of the OAuthConnector class

Properties

PropertyModifiersTypeDescription
appName?string
authData?AuthData
customAppName?string
inDevelopment?boolean
oauthConfigDataOAuthConfigData
proxied?boolean

Methods

MethodModifiersDescription
buildUrl(url, params)
getAccessTokenUrl()Get the url of the access token endpoint.
getAuthRequestUrl()
getAuthRequestUrlBase()
getAuthRequestUrlParams()
getRedirectUri()
getRefreshAccessTokenBody()
getRefreshAccessTokenHeaders()
getRefreshAccessTokenRedactKeys()
getRefreshTokenUrl()

Get the url of the refresh token endpoint

By default, returns the same url as the access token endpoint

getRequestAccessTokenBody(code)
getRequestAccessTokenHeaders()
getRequestAccessTokenParams(code)
getRequestAccessTokenRedactKeys()
post(props)
processRefreshAccessTokenResponse({ status, statusText, headers, text, })
processRequestAccessTokenResponse({ status, statusText, headers, text, })
redirectUri()
refreshAccessToken()
request(props)Make a proxied http request
requestAccessToken(code)