Class: HubSpotSDK::Resources::Auth::OAuth
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Auth::OAuth
- Defined in:
- lib/hubspot_sdk/resources/auth/oauth.rb
Instance Method Summary collapse
-
#create_token(client_id: nil, client_secret: nil, code: nil, code_verifier: nil, grant_type: nil, redirect_uri: nil, refresh_token: nil, scope: nil, request_options: {}) ⇒ StringIO
Authenticates a client and returns access and refresh tokens.
-
#initialize(client:) ⇒ OAuth
constructor
private
A new instance of OAuth.
-
#introspect_token(token: nil, client_id: nil, client_secret: nil, token_type_hint: nil, request_options: {}) ⇒ HubSpotSDK::Models::Auth::PublicAccessTokenInfoResponse, HubSpotSDK::Models::Auth::PublicRefreshTokenInfoResponse
Returns validity and metadata for access and refresh tokens.
-
#revoke_token(token: nil, client_id: nil, client_secret: nil, token_type_hint: nil, request_options: {}) ⇒ StringIO
Deletes/Revokes provided Refresh Token.
Constructor Details
#initialize(client:) ⇒ OAuth
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of OAuth.
89 90 91 |
# File 'lib/hubspot_sdk/resources/auth/oauth.rb', line 89 def initialize(client:) @client = client end |
Instance Method Details
#create_token(client_id: nil, client_secret: nil, code: nil, code_verifier: nil, grant_type: nil, redirect_uri: nil, refresh_token: nil, scope: nil, request_options: {}) ⇒ StringIO
Authenticates a client and returns access and refresh tokens.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/hubspot_sdk/resources/auth/oauth.rb', line 24 def create_token(params = {}) parsed, = HubSpotSDK::Auth::OAuthCreateTokenParams.dump_request(params) @client.request( method: :post, path: "oauth/2026-03/token", headers: {"content-type" => "application/x-www-form-urlencoded", "accept" => "*/*"}, body: parsed, model: StringIO, options: ) end |
#introspect_token(token: nil, client_id: nil, client_secret: nil, token_type_hint: nil, request_options: {}) ⇒ HubSpotSDK::Models::Auth::PublicAccessTokenInfoResponse, HubSpotSDK::Models::Auth::PublicRefreshTokenInfoResponse
Returns validity and metadata for access and refresh tokens.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/hubspot_sdk/resources/auth/oauth.rb', line 49 def introspect_token(params = {}) parsed, = HubSpotSDK::Auth::OAuthIntrospectTokenParams.dump_request(params) @client.request( method: :post, path: "oauth/2026-03/token/introspect", headers: {"content-type" => "application/x-www-form-urlencoded"}, body: parsed, model: HubSpotSDK::Auth::TokenInfoResponseBaseIf, options: ) end |
#revoke_token(token: nil, client_id: nil, client_secret: nil, token_type_hint: nil, request_options: {}) ⇒ StringIO
Deletes/Revokes provided Refresh Token
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/hubspot_sdk/resources/auth/oauth.rb', line 74 def revoke_token(params = {}) parsed, = HubSpotSDK::Auth::OAuthRevokeTokenParams.dump_request(params) @client.request( method: :post, path: "oauth/2026-03/token/revoke", headers: {"content-type" => "application/x-www-form-urlencoded", "accept" => "*/*"}, body: parsed, model: StringIO, options: ) end |