You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,7 +78,7 @@ Few good resources on this material which I found useful are:
78
78
std::cout << enc_str << std::endl;
79
79
80
80
//Decode
81
-
auto dec_obj = jwt::decode(enc_str, algorithms({"hs256"}), secret(key));
81
+
auto dec_obj = jwt::decode(enc_str, algorithms({"HS256"}), secret(key));
82
82
std::cout << dec_obj.header() << std::endl;
83
83
std::cout << dec_obj.payload() << std::endl;
84
84
@@ -96,7 +96,7 @@ Few good resources on this material which I found useful are:
96
96
Almost the same API, except for some ugliness here and there. But close enough!
97
97
98
98
Lets take another example in which we will see to add payload claim having type other than string.
99
-
The <code>payload</code> function used in the above example to create <code>jwt_object</code> object can only take strings. For anything else, it will throw a compilation error.
99
+
The <code>payload</code> function used in the above example to create <code>jwt_object</code> object can only take strings. For anything else, it will throw a compilation error.
100
100
101
101
For adding claims having values other than string, <code>jwt_object</code> class provides <code>add_claim</code> API. We will also see few other APIs in the next example. Make sure to read the comments :).
102
102
@@ -109,7 +109,7 @@ Few good resources on this material which I found useful are:
Optional parameter. To be supplied only when the algorithm used is not "NONE". Else would throw/set <code>KeyNotPresentError</code> / <code>KeyNotPresent</code> exception/error.
326
+
Optional parameter. To be supplied only when the algorithm used is not "none". Else would throw/set <code>KeyNotPresentError</code> / <code>KeyNotPresent</code> exception/error.
327
327
328
328
- <strong>leeway</strong>
329
329
@@ -365,7 +365,7 @@ All the parameters are basically a function which returns an instance of a type
365
365
366
366
- <strong>validate_jti</strong>
367
367
368
-
Optional parameter.
368
+
Optional parameter.
369
369
Takes a boolean value.
370
370
Validates the JTI claim. Only checks for the presence of the claim. If not throws or sets <code>InvalidJTIError</code> or <code>InvalidJTI</code>.
371
371
@@ -394,7 +394,7 @@ For the registered claim types the library assumes specific data types for the c
394
394
395
395
396
396
## Advanced Examples
397
-
We will see few complete examples which makes use of error code checks and exception handling.
397
+
We will see few complete examples which makes use of error code checks and exception handling.
398
398
The examples are taken from the "tests" section. Users are requested to checkout the tests to find out more ways to use this library.
399
399
400
400
Expiration verification example (uses error_code):
@@ -406,7 +406,7 @@ Expiration verification example (uses error_code):
0 commit comments