Skip to content

Commit

Permalink
Properly support issuer claim
Browse files Browse the repository at this point in the history
Closes #272
  • Loading branch information
waiting-for-dev committed Jul 12, 2024
1 parent 5313348 commit 929d13e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,13 @@ Request/response header which will transmit the JWT token.

Defaults to 'Authorization'

#### issuer

Expected issuer claim. If present, it will be checked against the incoming
token issuer claim and authorization will be skipped if they don't match.
Defaults to nil.
#### aud_header
Request header which content will be stored to the `aud` claim in the payload.
Expand Down
4 changes: 4 additions & 0 deletions lib/devise/jwt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def self.forward_to_warden(setting, value)
default: Warden::JWTAuth.config.token_header,
constructor: ->(value) { forward_to_warden(:token_header, value) })

setting(:issuer,
default: Warden::JWTAuth.config.issuer,
constructor: ->(value) { forward_to_warden(:issuer, value) })

setting(:aud_header,
default: Warden::JWTAuth.config.aud_header,
constructor: ->(value) { forward_to_warden(:aud_header, value) })
Expand Down

0 comments on commit 929d13e

Please sign in to comment.