Object -
jwt
:
InboundJwtAuthProvider
Represents the inbound JWT auth provider, which authenticates by validating a JWT.
The jwt:InboundJwtAuthProvider
is another implementation of the auth:InboundAuthProvider
interface.
jwt:InboundJwtAuthProvider inboundJwtAuthProvider = new({
issuer: "example",
audience: "ballerina",
trustStoreConfig: {
certificateAlias: "ballerina",
trustStore: {
path: "${ballerina.home}/bre/security/ballerinaTruststore.p12",
password: "ballerina"
}
}
});
Constructor
__init
(JwtValidatorConfig jwtValidatorConfig)
- jwtValidatorConfig JwtValidatorConfig
-
JWT validator configurations
Methods
Authenticates provided JWT against
jwt:JwtValidatorConfig
.
boolean|auth:Error result = inboundJwtAuthProvider.authenticate("<credential>");
Fields
- jwtValidatorConfig JwtValidatorConfig
-
JWT validator configurations
Authenticates provided JWT against
jwt:JwtValidatorConfig
.
boolean|auth:Error result = inboundJwtAuthProvider.authenticate("<credential>");
Parameters
- credential string
-
JWT to be authenticated
-
Return Type
(boolean | Error) true
if authentication is successful,false
otherwise or else anauth:Error
if JWT validation failed