v2026.6.4
All Bundles
Bundle OAuth client (-lib net_server)

OAuthClient

OAuth client

Example

scopes := ["https://www.googleapis.com/auth/cloud-platform", 
  "https://www.googleapis.com/auth/generative-language.retriever"];
client := System.IO.Net.OAuth.OAuthClient->New("client_secret.json", scopes);
each(i : 3) {
  client->GetToken()->GetAccessToken()->PrintLine();
};

Operations

GetToken #

Get an OAuth token

method : public : GetToken() ~ OAuthToken

Return

TypeDescription
OAuthTokenOAuth token, Nil if error

Example

scopes := ["https://www.googleapis.com/auth/drive.readonly"];
client := System.IO.Net.OAuth.OAuthClient->New("client_secret.json", scopes);
token := client->GetToken();
if(token <> Nil) {
  token->GetAccessToken()->PrintLine();
  token->IsExpired()->PrintLine();  # false
};

New # constructor

Constructor

New(filename:String, scopes:String[])

Parameters

NameTypeDescription
filenameStringOAuth configuration credentials in Google installed JSON format
scopesStringlist of OAuth scopes