Class: Api::OpenidConnect::IdToken

Inherits:
Object
  • Object
show all
Defined in:
lib/api/openid_connect/id_token.rb

Instance Method Summary collapse

Constructor Details

#initialize(authorization, nonce) ⇒ IdToken

Returns a new instance of IdToken.


31
32
33
34
35
36
# File 'lib/api/openid_connect/id_token.rb', line 31

def initialize(authorization, nonce)
  @authorization = authorization
  @nonce = nonce
  @created_at = Time.current
  @expires_at = 30.minutes.from_now
end

Instance Method Details

#to_jwt(options = {}) ⇒ Object


38
39
40
41
42
# File 'lib/api/openid_connect/id_token.rb', line 38

def to_jwt(options={})
  to_response_object(options).to_jwt(OpenidConnect::IdTokenConfig::PRIVATE_KEY) do |jwt|
    jwt.kid = :default
  end
end