Oauth2Connection::AuthorizeClient (open)
Start a redirecting authorization flow from the current page
Syntax
LOADLIB "mod::system/lib/webapi/oauth2.whlib";
RECORD FUNCTION AuthorizeClient(RECORD options)
Parameters
RECORD options
Options
STRING access_type
'offline' to request a refresh_token. defaults to 'online'
STRING code_verifier
A PKCE code verifier to use for authorization
RECORD extraparameters
Any extra parameters, eg [ prompt := "consent" ]
STRING ARRAY scopes
Requested scopes
Return value
RECORD
Success information
BOOLEAN success
True if we've succesfully authorized the client. AuthorizeClient redirects to the oauth2 flow if we don't have the token yet
Description
This function is designed to run the same webpage twice - first it will notice the oauthsession2= variable missing and redirect to the oauth pages. Oauth will then redirect back to the page, and we will return the token