Using Refresh Token from Multiple Projects

I have an integration setup where I am using OAuth to obtain a refresh token for a user. I am then using that refresh token to make API calls from two projects. One is the Web project that the user signs up with and the same project the refresh token was obtained from. This project can get an access token and use it with no issue. I also have another project that is listening to a queue so it can be separate and run long running tasks. When I use the refresh token from this project to obtain an access token I get an error back from the API: “status”:“MISMATCH_REFRESH_TOKEN_CLIENT”,“message”:“refresh token was not issued to this client”.
I am using the exact same parameters when getting the access token from refresh including grant_type, client_id, client_secret, redirect_uri, and refresh_token. Since both are coming from localhost this leads me to believe that HubSpot is doing a hidden check on the port it is from, because that should be the only thing different. Is there some documentation that I am missing to explain the proper way to do this?

Hi @WMoerke ,

In that case what you can do is you can make an custom api request to your First project where it is working and return the refresh token in response and then use it in the second project .

by the way i don’t found anything related to documented for using it in multiple places . It should work as usual

Getting the refresh token in the second project is not the issue. I already have access to the refresh token in the second project. The issue is that when I make an API call from the second project to get the access token using the refresh token from the first project, I get an error back instead of the access token.

Hi @WMoerke ,

I was also refering to generate access token from refresh token .

It turns out another developer on the project had put in code to change the client_id when in the development environment. I was not aware of this and didn’t expect there to be a different id for our development environment, so didn’t even check for that. This created a mismatch because one project was using our app’s id and the other was using the changed development environment id. Once I got rid of that and they were both using the correct client_id all was working perfectly. Thanks all