Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Add optional fields to token response
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Ruff <[email protected]>
  • Loading branch information
databus23 committed Feb 18, 2016
1 parent 51b780d commit f74eb2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/portus/jwt_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ def initialize(account, service, scopes)
# response.
def encoded_hash
headers = { "kid" => JwtToken.kid(private_key) }
{ token: JWT.encode(claim.deep_stringify_keys, private_key, "RS256", headers) }.freeze
{
token: JWT.encode(claim.deep_stringify_keys, private_key, "RS256", headers),
expires_in: expiration_time,
issued_at: Time.zone.at(issued_at).to_datetime.rfc3339
}.freeze
end

# Returns a hash containing the "Claim" set as described in the
Expand Down

0 comments on commit f74eb2e

Please sign in to comment.