verify(const std::string &token)¶
Verifies the token.
[in] token: String containing the JSON Web Token.
add_verification_policy(const VerificationPolicy &policy)¶
Adds a policy to resolve the verification strategy to use.
The VerificationPolicy should set the VerificationStrategy and returns true if it is able to provide a strategy. If there are multiple policies that can process a token, the 1st policy that matches is used. VerificationPolicyFactory contains some simple predefined policies.
The idea is that JwtValidator should support verifying in multiple use cases. For example, choosing a secret based on the issuer or other claims and any custom strategy as required. There is no way to open up such flexibility from within the class so the conclusion is to have a handler that the consumer supplies to choose the verification method.
[in] policy: The policy to be added.
Class containing all the relevant information about the verification policy, which includes the public key or the secret key used for generating the token.
Rule= std::pair<std::string, std::string>¶