Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'iss' support for ruby-jwt #61

Merged
merged 4 commits into from
Mar 9, 2015
Merged

Add 'iss' support for ruby-jwt #61

merged 4 commits into from
Mar 9, 2015

Conversation

ZhangHanDong
Copy link
Contributor

add iss support, usage (in rspec):

example_payload = {"hello" => "world", "iss" => 'jwtiss'}
example_secret = 'secret'
example_jwt = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJoZWxsbyI6IndvcmxkIiwiaXNzIjoiand0aXNzIn0.nTZkyYfpGUyKULaj45lXw_1gXXjHvGW4h5V7okHdUqQ'

JWT.decode(example_jwt, example_secret, true, {iss: 'jwtiss'})

or

begin
    JWT.decode(example_jwt, "secret"t, true, {iss: 'jwtiss'})
rescue JWT::InvalidIssuerError
    # Invalid issuer
end

excpt added a commit that referenced this pull request Mar 9, 2015
Add  'iss'  support for ruby-jwt
@excpt excpt merged commit 93f2977 into jwt:master Mar 9, 2015
@excpt
Copy link
Member

excpt commented Mar 9, 2015

Thanks @ZhangHanDong for the pull request.

All specs pass.

Merged! 🍻

@ZhangHanDong
Copy link
Contributor Author

🍻

I looked forward to use 'iss' with new gem package . thanks @excpt

@excpt
Copy link
Member

excpt commented Mar 9, 2015

I'll write some documentation when I'm home and then I will push a new gem version. :)

@ZhangHanDong
Copy link
Contributor Author

@excpt thanks。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants