Class: OAuth2::Server::Flows::WebServer
- Inherits:
-
Object
- Object
- OAuth2::Server::Flows::WebServer
- Includes:
- Attributes
- Defined in:
- lib/oauth2/server/flows/web_server.rb
Instance Method Summary collapse
-
#access_token ⇒ Object
TODO.
- #create_ticket(&block) ⇒ Object
-
#grant_authorization ⇒ Object
If the user authorized the client, we create a verification code.
-
#request_authorization ⇒ Object
This method will create a ticket for the client and try to identify and verify the resource owner.
Instance Method Details
#access_token ⇒ Object
TODO
46 47 48 49 |
# File 'lib/oauth2/server/flows/web_server.rb', line 46 def access_token # TODO: verify that type == "web_sever" # TODO: verify that redirect_uri == ticket.redirect_uri end |
#create_ticket(&block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/oauth2/server/flows/web_server.rb', line 13 def create_ticket(&block) if block_given? callbacks[:create_ticket] = block else block.call end end |
#grant_authorization ⇒ Object
If the user authorized the client, we create a verification code. Then we redirect back with the verification code or an error message.
40 41 42 43 |
# File 'lib/oauth2/server/flows/web_server.rb', line 40 def create_verification_code if redirect_back end |
#request_authorization ⇒ Object
This method will create a ticket for the client and try to identify and verify the resource owner. If those two steps succeed, it displays the authorization form.
28 29 30 31 32 |
# File 'lib/oauth2/server/flows/web_server.rb', line 28 def create_ticket verify_resource_owner or return end |