Oauth2Connection (open)
Manages the oauth2 WebBrowser
Syntax
LOADLIB "mod::system/lib/webapi/oauth2.whlib";
OBJECTTYPE Oauth2Connection
Constructor
Variables
- STRING authorization_header_type
Some providers (eg Zoho) requirer a different token than "Bearer" as authorization type
- BOOLEAN expires_in_msecs
Some providers (eg Zoho) set a wrong unit for 'expires_in'
Properties
Functions
- RECORD FUNCTION AuthorizeClient(RECORD options)
Start a redirecting authorization flow from the current page
- RECORD FUNCTION GetAuthorizeContext(RECORD options)
Prepare the data needed to start an authorization flow
- RECORD FUNCTION HandleAuthorizedLanding(STRING oauth2session)
- BOOLEAN FUNCTION IsAccessTokenExpired(RECORD options)
Is this token still usable?
- RECORD FUNCTION RefreshAccessToken()
Get a new accesstoken using our refresh token. This call updates this->token if succesful
- RECORD FUNCTION RequestClientCredentials(RECORD options)
Request client credentials (authorizing the app itself, not a specific user)
- RECORD FUNCTION RequestToken(STRING code, RECORD options)
- RECORD FUNCTION SetupClientCredentialsUsingRegistryKey(STRING keyname, RECORD options)
Grab client credentials from a registry key, requesting or extending if necessary.
- RECORD FUNCTION SetupTokenUsingRegistryKey(STRING keyname)
Grab a token from a registry key, extending it if necessary
- RECORD FUNCTION StartAuthorizeClient(STRING finalreturnurl, RECORD options)
Get the submitinstruction to start an authorziation flow