Class: Api::OpenidConnect::AuthorizationPoint::Endpoint

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Endpoint

Returns a new instance of Endpoint.


11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 11

def initialize(user)
  @user = user
  @app = Rack::OAuth2::Server::Authorize.new do |req, res|
    build_from_request_object(req)
    build_attributes(req, res)
    if OAuthApplication.available_response_types.include? Array(req.response_type).join(" ")
      handle_response_type(req, res)
    else
      req.unsupported_response_type!
    end
  end
end

Instance Attribute Details

#appObject

Returns the value of attribute app


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def app
  @app
end

#nonceObject

Returns the value of attribute nonce


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def nonce
  @nonce
end

#o_auth_applicationObject

Returns the value of attribute o_auth_application


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def o_auth_application
  @o_auth_application
end

#redirect_uriObject

Returns the value of attribute redirect_uri


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def redirect_uri
  @redirect_uri
end

#request_objectObject

Returns the value of attribute request_object


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def request_object
  @request_object
end

#request_uriObject

Returns the value of attribute request_uri


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def request_uri
  @request_uri
end

#response_typeObject

Returns the value of attribute response_type


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def response_type
  @response_type
end

#scopesObject

Returns the value of attribute scopes


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def scopes
  @scopes
end

#userObject

Returns the value of attribute user


7
8
9
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 7

def user
  @user
end

Instance Method Details

#build_attributes(req, res) ⇒ Object


24
25
26
27
28
29
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 24

def build_attributes(req, res)
  build_client(req)
  build_redirect_uri(req, res)
  verify_nonce(req, res)
  build_scopes(req)
end

#handle_response_type(_req, _res) ⇒ Object

Raises:

  • (NotImplementedError)

31
32
33
# File 'lib/api/openid_connect/authorization_point/endpoint.rb', line 31

def handle_response_type(_req, _res)
  raise NotImplementedError # Implemented by subclass
end