v2026.2.1
All Bundles

OAuthClient

OAuth client

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

New

Constructor

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

Parameters

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