Integration with OAuth 2.0

contacts

#1

Initiate an Integration with OAuth 2.0 with the redirect url in passing other options like type=abcd,

so after passing the options, but remove my option. so any other idea or method for passing the parameter with static values.

this is the my request URL: let auth_url = login + "/oauth/authorize?client_id=" + clientid + "&scope=contacts%20automation&redirect_uri=" + redirect + "&type=abcd";


#3

Hi @Ankit,

At this time, redirect URIs cannot contain query parameters, so they are stripped. (See this similar topic.)

Could you describe your use case in more detail? What types of parameters and values are you passing at this stage in the connection process?


#4

i passed the parameter with static value and after i get the same value in redirect page? is it possible?

like : i call Integration with OAuth 2.0

https://app.hubspot.com/oauth/authorize?client_id=xxxx-xxx-xxx&scope=contacts%20automation&redirect_uri=https://localhost:3000/integration/auth?token=HubSpot

but i can't get the token paramter with value in redierct page,

but get this type of return url :
https://localhost:3000/integration/auth?token&code=xxxxx-xxx-xxxx


#5

Hi @Ankit,

No, that is not possible at this time. All custom query parameters are removed.

What kinds of tokens or values are you trying to pass?


#6

Thanks for quick replay,

passing just simple static values of identifying and run custom query.

Like :: i pass the key="value" if i just get return the key and value in url, after fire custom action on db and other.

Thanks


#7

Hi @Ankit,

Unfortunately, it's not possible to pass any custom query parameters in the redirect URI.

If you need to get identifying information for the portal which is integrating with you, one way is to use this endpoint, though.


#8

Does the HubSpot OAuth 2.0 support the state parameter (i.e. https://auth0.com/docs/protocols/oauth2/oauth-state) on the initial authorization request? If so, that is typically the way to pass data from the initial auth request to the redirect url.


#9

Thanks for the input, @Eric_Wood. Per this topic, the state parameter does seem to be supported.