From e49093f6d16378c3798ed48be640194b51dafc02 Mon Sep 17 00:00:00 2001 From: Matteo Baccan Date: Fri, 11 Mar 2022 01:33:36 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a245989..874a2c6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A simple library to work with JSON Web Token and JSON Web Signature for Harbour Package is available on [GitHub](https://github.com/matteobaccan/HarbourJwt/blob/main/lib/jwt.hrb), ```shell -wget https://github.com/matteobaccan/HarbourJwt/blob/main/lib/jwt.hrb +wget https://github.com/matteobaccan/HarbourJwt/blob/main/lib/jwt.hrb?raw=true ``` ## Documentation @@ -112,4 +112,4 @@ oJWT:GetError() You can get the decode error ## Contribution -Feel free to update this code with new PR \ No newline at end of file +Feel free to update this code with new PR From 7b3536b1ae714985182b5a6def68e0e28b6c9eb8 Mon Sep 17 00:00:00 2001 From: Matteo Baccan Date: Fri, 11 Mar 2022 01:37:44 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 874a2c6..eeff5a6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ wget https://github.com/matteobaccan/HarbourJwt/blob/main/lib/jwt.hrb?raw=true JWT is a class library that can allow you to generate and validate JWT tokens ### Token generation -For create a token you must +To create a token you must 1. Load jwt,hrb library @@ -33,7 +33,7 @@ LOCAL cToken oJWT := &("JWT():new()") ``` -3. Configure a valid header, setting Type = JWT and an available Algorithm. At the moment the Algorithms available are: HS256, HS384 and HS512 +3. Configure a valid header, setting Type = JWT and an available Algorithm. At the moment the Algorithms available are: HS256, HS384, and HS512 ``` // Header @@ -53,7 +53,7 @@ METHOD SetIssuedAt( nIssuedAt ) METHOD SetJWTId( cJWTId ) ``` -A simple payload can be formed by: Subject, Name and IssueAt +A simple payload can be formed by: Subject, Name, and IssueAt ``` // Payload @@ -81,7 +81,7 @@ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4 ``` ### Token verification -Token verifications are also symple +Token verifications are also simple 1. Load jwt.hrb library @@ -104,12 +104,12 @@ oJWT := &("JWT():new()") oJWT:Decode("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ik1hdHRlbyBCYWNjYW4iLCJpYXQiOjE1MTYyMzkwMjJ9.YR8QF52kgj0owYlP9TkEy_lNhC-Qdq38tqNNNqpvpK0", "MySecret") ``` -Decode return a .T. if token is valid. Other wise with +Decode return a .T. if the token is valid. Otherwise with ``` oJWT:GetError() ``` -You can get the decode error +you can get the decode error ## Contribution -Feel free to update this code with new PR +Feel free to update this code with a new PR