clients/hydra/ruby/lib/ory-hydra-client/api/public_api.rb
# The OAuth 2.0 Token Endpoint
# The client makes a request to the token endpoint by sending the following parameters using the \&quot;application/x-www-form-urlencoded\&quot; HTTP request entity-body.  &gt; Do not implement a client for this endpoint yourself. Use a library. There are many libraries &gt; available for any programming language. You can find a list of libraries here: https://oauth.net/code/ &gt; &gt; Do note that Hydra SDK does not implement this endpoint properly. Use one of the libraries listed above!
# @param grant_type [String] 
# @param [Hash] opts the optional parameters
# @option opts [String] :code 
# @option opts [String] :refresh_token 
# @option opts [String] :redirect_uri 
# @option opts [String] :client_id 
# @return [Array<(Oauth2TokenResponse, Integer, Hash)>] Oauth2TokenResponse data, response status code and response headers
The OAuth 2.0 Token Endpoint
The client makes a request to the token endpoint by sending the following parameters using the \"application/x-www-form-urlencoded\" HTTP request entity-body.  > Do not implement a client for this endpoint yourself. Use a library. There are many libraries > available for any programming language.
The OAuth 2 . 0 Token Endpoint The client makes a request to the token endpoint by sending the following parameters using the \ " application / x - www - form - urlencoded \ " HTTP request entity - body . > Do not implement a client for this endpoint yourself . Use a library . There are many libraries > available for any programming language .
def oauth2_token_with_http_info(grant_type, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: PublicApi.oauth2_token ...'
      end
      if @api_client.config.client_side_validation && grant_type.nil?
        fail ArgumentError, "Missing the required parameter 'grant_type' when calling PublicApi.oauth2_token"
      end
      local_var_path = '/oauth2/token'
      query_params = opts[:query_params] || {}
      header_params = opts[:header_params] || {}
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
      form_params = opts[:form_params] || {}
      form_params['grant_type'] = grant_type
      form_params['code'] = opts[:'code'] if !opts[:'code'].nil?
      form_params['refresh_token'] = opts[:'refresh_token'] if !opts[:'refresh_token'].nil?
      form_params['redirect_uri'] = opts[:'redirect_uri'] if !opts[:'redirect_uri'].nil?
      form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
      post_body = opts[:debug_body]
      return_type = opts[:debug_return_type] || 'Oauth2TokenResponse'
      auth_names = opts[:debug_auth_names] || ['basic', 'oauth2']
      new_options = opts.merge(
        :operation => :"PublicApi.oauth2_token",
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => return_type
      )
      data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: PublicApi#oauth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def oauth2_token_with_http_info ( grant_type , opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: PublicApi.oauth2_token ...' end if @api_client . config . client_side_validation && grant_type . nil? fail ArgumentError , "Missing the required parameter 'grant_type' when calling PublicApi.oauth2_token" end local_var_path = '/oauth2/token' query_params = opts [ :query_params ] || { } header_params = opts [ :header_params ] || { } header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] ) header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'application/x-www-form-urlencoded' ] ) form_params = opts [ :form_params ] || { } form_params [ 'grant_type' ] = grant_type form_params [ 'code' ] = opts [ :' code ' ] if ! opts [ :' code ' ] . nil? form_params [ 'refresh_token' ] = opts [ :' refresh_token ' ] if ! opts [ :' refresh_token ' ] . nil? form_params [ 'redirect_uri' ] = opts [ :' redirect_uri ' ] if ! opts [ :' redirect_uri ' ] . nil? form_params [ 'client_id' ] = opts [ :' client_id ' ] if ! opts [ :' client_id ' ] . nil? post_body = opts [ :debug_body ] return_type = opts [ :debug_return_type ] || 'Oauth2TokenResponse' auth_names = opts [ :debug_auth_names ] || [ 'basic' , 'oauth2' ] new_options = opts . merge ( :operation => :" PublicApi.oauth2_token " , :header_params => header_params , :query_params => query_params , :form_params => form_params , :body => post_body , :auth_names => auth_names , :return_type => return_type ) data , status_code , headers = @api_client . call_api ( :POST , local_var_path , new_options ) if @api_client . config . debugging @api_client . config . logger . debug "API called: PublicApi#oauth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
The OAuth 2.0 Token Endpoint
The client makes a request to the token endpoint by sending the following parameters using the \&quot;application/x-www-form-urlencoded\&quot; HTTP request entity-body.
The OAuth 2 . 0 Token Endpoint The client makes a request to the token endpoint by sending the following parameters using the \ &quot ; application / x - www - form - urlencoded \ &quot ; HTTP request entity - body .
# verify the required parameter 'grant_type' is set # resource path # query parameters # header parameters # HTTP header 'Accept' (if needed) # HTTP header 'Content-Type' # form parameters # http body (model) # return_type # auth_names
Oauth2TokenResponse data, response status code and response headers
Oauth2TokenResponse data response status code and response headers
Array<(Oauth2TokenResponse, Integer, Hash)>
grant_type
<not_specific>
opts
None
<not_specific>
None
<not_specific>
opts the optional parameters
opts the optional parameters