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: "/path/to/truststore.p12",
password: "ballerina"
}
}
});
Constructor
__init
(JwtValidatorConfig jwtValidatorConfig)
- jwtValidatorConfig JwtValidatorConfig
-
JWT validator configurations
Methods
Authenticates provided JWT against jwt:JwtValidatorConfig.
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) trueif authentication is successful,falseotherwise or else anauth:Errorif JWT validation failed