clients/hydra/ruby/lib/ory-hydra-client/api/admin_api.rb
# Introspect OAuth2 Tokens
# The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. You can set additional data for a token by setting &#x60;accessTokenExtra&#x60; during the consent flow.  For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/).
# @param token [String] The string value of the token. For access tokens, this is the \\\&quot;access_token\\\&quot; value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the \\\&quot;refresh_token\\\&quot; value returned.
# @param [Hash] opts the optional parameters
# @option opts [String] :scope An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false.
# @return [Array<(OAuth2TokenIntrospection, Integer, Hash)>] OAuth2TokenIntrospection data, response status code and response headers
Introspect OAuth2 Tokens
The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token is neither expired nor revoked. If a token is active, additional information on the token will be included. You can set additional data for a token by setting `accessTokenExtra` during the consent flow.  For more information [read this blog post].
Introspect OAuth2 Tokens The introspection endpoint allows to check if a token ( both refresh and access ) is active or not . An active token is neither expired nor revoked . If a token is active additional information on the token will be included . You can set additional data for a token by setting ` accessTokenExtra ` during the consent flow . For more information [ read this blog post ] .
def introspect_o_auth2_token_with_http_info(token, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: AdminApi.introspect_o_auth2_token ...'
      end
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling AdminApi.introspect_o_auth2_token"
      end
      local_var_path = '/oauth2/introspect'
      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['token'] = token
      form_params['scope'] = opts[:'scope'] if !opts[:'scope'].nil?
      post_body = opts[:debug_body]
      return_type = opts[:debug_return_type] || 'OAuth2TokenIntrospection'
      auth_names = opts[:debug_auth_names] || []
      new_options = opts.merge(
        :operation => :"AdminApi.introspect_o_auth2_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: AdminApi#introspect_o_auth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
def introspect_o_auth2_token_with_http_info ( token , opts = { } ) if @api_client . config . debugging @api_client . config . logger . debug 'Calling API: AdminApi.introspect_o_auth2_token ...' end if @api_client . config . client_side_validation && token . nil? fail ArgumentError , "Missing the required parameter 'token' when calling AdminApi.introspect_o_auth2_token" end local_var_path = '/oauth2/introspect' 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 [ 'token' ] = token form_params [ 'scope' ] = opts [ :' scope ' ] if ! opts [ :' scope ' ] . nil? post_body = opts [ :debug_body ] return_type = opts [ :debug_return_type ] || 'OAuth2TokenIntrospection' auth_names = opts [ :debug_auth_names ] || [ ] new_options = opts . merge ( :operation => :" AdminApi.introspect_o_auth2_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: AdminApi#introspect_o_auth2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data , status_code , headers end
Introspect OAuth2 Tokens
The introspection endpoint allows to check if a token (both refresh and access) is active or not.
Introspect OAuth2 Tokens The introspection endpoint allows to check if a token ( both refresh and access ) is active or not .
# verify the required parameter 'token' 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
OAuth2TokenIntrospection data, response status code and response headers
OAuth2TokenIntrospection data response status code and response headers
Array<(OAuth2TokenIntrospection, Integer, Hash)>
token
The string value of the token. For access tokens, this is the \\\"access_token\\\" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the \\\"refresh_token\\\" value returned.
The string value of the token . For access tokens this is the \\\ " access_token \\\ " value returned from the token endpoint defined in OAuth 2 . 0 . For refresh tokens this is the \\\ " refresh_token \\\ " value returned .
opts
:scope An optional, space separated list of required scopes. If the access token was not granted one of the scopes, the result of active will be false.
: scope An optional space separated list of required scopes . If the access token was not granted one of the scopes the result of active will be false .
<not_specific>
opts the optional parameters
opts the optional parameters