Skip to content

Commit

Permalink
Merge pull request #114 from FXFusion/master
Browse files Browse the repository at this point in the history
Updated readme for iss/aud options
  • Loading branch information
excpt committed Nov 17, 2015
2 parents 6c84213 + e5a94db commit cabde34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ token = JWT.encode iss_payload, hmac_secret, 'HS256'

begin
# Add iss to the validation to check if the token has been manipulated
decoded_token = JWT.decode token, hmac_secret, true, { 'iss' => iss, :verify_iss => true, :algorithm => 'HS256' }
decoded_token = JWT.decode token, hmac_secret, true, { :iss => iss, :verify_iss => true, :algorithm => 'HS256' }
rescue JWT::InvalidIssuerError
# Handle invalid token, e.g. logout user or deny access
end
Expand All @@ -247,7 +247,7 @@ token = JWT.encode aud_payload, hmac_secret, 'HS256'

begin
# Add aud to the validation to check if the token has been manipulated
decoded_token = JWT.decode token, hmac_secret, true, { 'aud' => aud, :verify_aud => true, :algorithm => 'HS256' }
decoded_token = JWT.decode token, hmac_secret, true, { :aud => aud, :verify_aud => true, :algorithm => 'HS256' }
rescue JWT::InvalidAudError
# Handle invalid token, e.g. logout user or deny access
puts 'Audience Error'
Expand Down

0 comments on commit cabde34

Please sign in to comment.