Class: ListenerJwtAuthHandler

Defines the JWT auth handler for listener authentication.

Constructor

Initializes the http:ListenerJwtAuthHandler object.

init (JwtValidatorConfig config)

Methods

authenticate

Authenticates with the relevant authentication requirements.

authorize

Authorizes with the relevant authorization requirements.

authenticate

function authenticate(Request | Headers | string data) returns Payload | Unauthorized
Isolated Function

Authenticates with the relevant authentication requirements.

Parameters

  • data Request | Headers | string
  • The http:Request instance or http:Headers instance or string Authorization header

Return Type

(Payload | Unauthorized)

The jwt:Payload instance or else Unauthorized type in case of an error

authorize

function authorize(Payload jwtPayload, string | string[ ] expectedScopes) returns Forbidden?
Isolated Function

Authorizes with the relevant authorization requirements.

Parameters

  • jwtPayload Payload
  • The jwt:Payload instance which is received from authentication results

  • expectedScopes string | string[ ]
  • The expected scopes as string or string[]

Return Type

(Forbidden?)

(), if it is successful or else Forbidden type in case of an error