Class: Toolchest::Oauth::TokensController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/toolchest/oauth/tokens_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /mcp/oauth/token



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/toolchest/oauth/tokens_controller.rb', line 6

def create
  case params[:grant_type]
  when "authorization_code"
    handle_authorization_code
  when "refresh_token"
    handle_refresh_token
  else
    error_response("unsupported_grant_type", "Grant type '#{params[:grant_type]}' is not supported")
  end
end