Class: Oauth2Provider::AuthorizeController
Instance Method Summary
collapse
#_oauth_provider_admin?
#_oauth_provider_authenticate, #_oauth_provider_json_body, #_oauth_provider_normalize_token, #api_request, #json?, #oauth_authorized, #session_auth
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/oauth2_provider/authorize_controller.rb', line 18
def create
@client.granted!
if params[:response_type] == "code"
@authorization = Oauth2Provider::OauthAuthorization.create(client_uri: @client.uri, resource_owner_uri: user_url(current_user), scope: params[:scope])
redirect_to authorization_redirect_uri(@client, @authorization, params[:state])
end
if params[:response_type] == "token"
@token = Oauth2Provider::OauthToken.create(client_uri: @client.uri, resource_owner_uri: user_url(current_user), scope: params[:scope])
redirect_to implicit_redirect_uri(@client, @token, params[:state])
end
end
|
#destroy ⇒ Object
34
35
36
37
|
# File 'app/controllers/oauth2_provider/authorize_controller.rb', line 34
def destroy
@client.revoked!
redirect_to deny_redirect_uri(@client, params[:response_type], params[:state])
end
|
#show ⇒ Object
14
15
16
|
# File 'app/controllers/oauth2_provider/authorize_controller.rb', line 14
def show
render "shared/authorize" and return
end
|