Class
-
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",
signatureConfig: {
certificateAlias: "ballerina",
trustStore: {
path: "/path/to/truststore.p12",
password: "ballerina"
}
}
});
Methods
Authenticates provided JWT against jwt:JwtValidatorConfig.
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