Skip to content

Commit

Permalink
apply workaround from
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc committed Dec 27, 2023
1 parent 1b12293 commit cced165
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions example/rsa-verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ YwIDAQAB
"sGQxiVqtRHKXZR9RbfvjrErY1KGiCp9M5i2bsUHadZEY44FE2jiOmx-"
"uc2z5c05CCXqVSpfCjWbh9gQ";

/* [input] */
auto verify = jwt::verify().allow_algorithm(jwt::algorithm::rs256(rsa_pub_key, "", "", "")).with_issuer("auth0");
/* [input] */

/* [allow rsa algorithm] */
auto verify = jwt::verify()
// We only need an RSA public key to verify tokens
.allow_algorithm(jwt::algorithm::rs256(rsa_pub_key, "", "", ""))
// We expect token to come from a known authorization server
.with_issuer("auth0");
/* [allow rsa algorithm] */

auto decoded = jwt::decode(token);

verify.verify(decoded);
Expand Down
2 changes: 1 addition & 1 deletion include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3495,7 +3495,7 @@ namespace jwt {
* which the authorization server is provided. For example a small system
* where only a single RSA key-pair is used to sign tokens
*
* \snippet example/rsa-verify.cpp input
* \snippet{trimleft} example/rsa-verify.cpp allow rsa algorithm
*
* \tparam Algorithm any algorithm such as those provided by jwt::algorithm
* \param alg Algorithm to allow
Expand Down

0 comments on commit cced165

Please sign in to comment.