Home > Class Reference > %SYS namespace > %OAuth2.Server.Validate

%OAuth2.Server.Validate

class %OAuth2.Server.Validate extends %Library.RegisteredObject

Your custom ValidateDelegatedAuthentication method must return true only if the delegated authentication event initiated by the DelegatedAuthentication method in the Authenticate class is valid. It must return false in other cases.

The properties.CustomProperties array may be used to pass values between the DelegatedAuthentication method and this one.

Method Inventory

Methods

classmethod SupportedClaims() as %List [ Language = objectscript ]
The SupportedClaims method returns a $list of claims that are supported by this authorization server based on customizations. The SupportedClaims method is in the ValidateUserClass since this is where additional claims are usually added. The returned list is added to the list of claims defined by OpenID Connect Core and should include JWT, IDToken, userinfo endpoint and introspection endpoint claims.
classmethod ValidateClient(clientId As %String, clientSecret As %String, scope As %ArrayOfDataTypes, Output properties As %OAuth2.Server.Properties, Output sc As %Status) as %Boolean [ Language = objectscript ]
The ValidateClient method returns true (1), if the client_id and client_secret refer to a client computer which may use the client credentials grant type based on whatever criteria the method chooses to implement. This client will already have been verified to be registered to this authorization server and thus will usually be accepted. ValidateClient populates the properties array argument with any properties needed to generate the access token. This correspond to the Properties arguments of OAuth2.Server.Token. The authorization server will always add the "iss" (URL of authorization server), "sub" (client_id), and "exp" (expiration time in seconds since December 31st, 1840) to ClaimValues and "client_id" (client_id of the requesting client) to CusotmProperties after return from ValidateUser if they have not already been added.
If not valid then false is returned.
This default ValidateClient accepts all clients and adds no properties.
classmethod ValidateDelegatedAuthentication(properties As %OAuth2.Server.Properties, Output username As %String, Output sc As %Status) as %Boolean [ Language = objectscript ]
classmethod ValidateUser(username As %String, password As %String, scope As %ArrayOfDataTypes, properties As %OAuth2.Server.Properties, Output sc As %Status) as %Boolean [ Language = objectscript ]
Your custom ValidateUser method must return true (1) only if the username and password refer to a valid user based on whatever criteria you choose to implement. It must return false in other cases.

If password="", then the user is already logged into an existing session and the password does not need to be validated.

In addition, this method receives the properties array and can further modify it; this correspond to the Properties property of %OAuth2.Server.Token. The authorization server will always add the "iss" (URL of authorization server), "sub" (client_id), and "exp" (expiration time in seconds since December 31st, 1840) to ClaimValues and "client_id" (client_id of the requesting client) to CusotmProperties after return from ValidateUser if they have not already been added.

This sample ValidateUser method validates the user based on the users for this instance.

Inherited Members

Inherited Methods

FeedbackOpens in a new window