class Doorkeeper::OAuth::IdTokenRequest

Attributes

auth[RW]
pre_auth[RW]
resource_owner[RW]

Public Class Methods

new(pre_auth, resource_owner) click to toggle source
# File lib/doorkeeper/oauth/id_token_request.rb, line 6
def initialize(pre_auth, resource_owner)
  @pre_auth       = pre_auth
  @resource_owner = resource_owner
end

Public Instance Methods

authorize() click to toggle source
# File lib/doorkeeper/oauth/id_token_request.rb, line 11
def authorize
  if pre_auth.authorizable?
    @auth = Authorization::Token.new(pre_auth, resource_owner)
    @auth.issue_token
    @response = response
  else
    @response = error_response
  end
end
deny() click to toggle source
# File lib/doorkeeper/oauth/id_token_request.rb, line 21
def deny
  pre_auth.error = :access_denied
  error_response
end

Private Instance Methods

error_response() click to toggle source
# File lib/doorkeeper/oauth/id_token_request.rb, line 34
def error_response
  ErrorResponse.from_request pre_auth,
                             redirect_uri: pre_auth.redirect_uri,
                             response_on_fragment: true
end
response() click to toggle source
# File lib/doorkeeper/oauth/id_token_request.rb, line 28
def response
  id_token = Doorkeeper::OpenidConnect::IdToken.new(auth.token, pre_auth.nonce)

  IdTokenResponse.new(pre_auth, auth, id_token)
end