Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [%OAuth2] >  [Server] >  [Generate]
Private  Storage   

class %OAuth2.Server.Generate extends %RegisteredObject

The %OAuth2.Server.Generate is the default GenerateTokenClass which is included with the server. The default class will generate a random string as the opaque access token.
The GenerateTokenClass is specified in the Authorization Server Configuration. It must contain a GenerateAccessToken method will be used to generate an access token based on the array of properties that is returned by the ValidateUser method.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
3


Summary

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
GenerateAccessToken IsJWT OnRefreshAccessToken

Subclasses
%OAuth2.Server.JWT

Methods

• classmethod GenerateAccessToken(properties As %OAuth2.Server.Properties, Output sc As %Status) as %String
The GenerateAccessToken method returns an access token. The access token may be based on the properties argument. In addition values for claims to be added to the JSON response object may be returned in the properties.ResponseProperties array.
However the method in this default class just returns an opaque random string.
• classmethod IsJWT() as %Boolean
The IsJWT method returns true if the GenerateAccessToken method returns a JWT. IsJWT is used to determine inclusion of algorithms for access token in server metadata.
• classmethod OnRefreshAccessToken(properties As %OAuth2.Server.Properties) as %Status
The OnRefreshAccessToken method will be called when a new access token is granted based on a refresh token. If this method returns an error status, the refresh token request will fail.


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.