diff --git a/example/rsa-verify.cpp b/example/rsa-verify.cpp index 75bf0a172..68e7d3be0 100644 --- a/example/rsa-verify.cpp +++ b/example/rsa-verify.cpp @@ -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); diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 860540859..719300bdd 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -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