Class: ListenerJwtAuthProvider
Isolated
Represents the listener JWT Auth provider, which is used to authenticate the provided credentials (JWT) against the provided JWT validator configurations.
1jwt:ListenerJwtAuthProvider provider = new({2 issuer: "example",3 audience: "ballerina",4 signatureConfig: {5 certificateAlias: "ballerina",6 trustStore: {7 path: "/path/to/truststore.p12",8 password: "ballerina"9 }10 }11});
Constructor
Provides authentication based on the provided JWT.
init (ValidatorConfig validatorConfig)
- validatorConfig ValidatorConfig
JWT validator configurations
Methods
authenticate | Authenticates the provided JWT. |
authenticate
Isolated Function
Authenticates the provided JWT.
1boolean result = check provider.authenticate("<credential>");
Parameters
- credential string
JWT to be authenticated