A client-side endpoint (can only be queried from the user's browser) that starts the HubSpot OAuth flow. This endpoint generates the HubSpot OAuth URL with all required fields and redirects the user to that URL. The user authenticates with HubSpot before getting redirected back to Stytch. After verifying the request, Stytch redirects the user back to the discovery_redirect_url provided.
Scopes
By default our HubSpot OAuth integration requests the oauth scope. You may add any additional HubSpot API scopes (see here for a complete list) as a space separated list in the custom_scopes query parameter.
Additional provider parameters
Any parameters that should be forwarded to the OAuth provider can be passed as query parameters with the provider_ prefix. For example, some OAuth providers support a login_hint parameter that allows you to pre-populate the OAuth login flow with a suggested email address. To specify the login_hint parameter in your OAuth request, you'd include provider_login_hint=exampleHint as a query parameter. We recommend consulting each OAuth provider's documentation for a list of supported parameters.
Next steps
Once the user successfully authenticates with HubSpot, they'll be redirected to the redirect URL that you provided at the start of the OAuth flow with a Stytch OAuth token. Collect the token from the URL query parameters, and call Authenticate Discovery OAuth to exchange it for an Intermediate Session Token. Intermediate Session Tokens can be used for various Discovery login flows and are valid for 10 minutes.