Get new Access Token using Refresh Token in resource owner password flow

Hi @rueben.tiow

Thank you for your quick response.

I am testing on a different account that is why the audience parameter is wrong.
In the previous i used the parameter found in the API Audience.
As you have suggested i have added client_secret

   const refreshBody = {
        client_id: "client_id",
        client_secret: "secret",
        grant_type: "refresh_token",
        realm: "custom_db",
        audience: "API Audience",
        scope: "offline_access",
        refresh_token: "refresh_token"
    }


    const { data: refreshData } = await axios.post("URL", refreshBody,
        {
            headers: { 'Content-Type': 'application/x-www-form-urlencoded', }
        })

Note:
I have different API’s and each API connect to different Database connection.
I am building a authentication server where multiple application uses it to login.

For the above code i am getting the following response

data: {
  error: 'access_denied',
  error_description: 'Product information invalid access denied'
}
  • It is also important to note that when i tested the above code when i have only one API and one DB connection it is working. I was able to get the new access token.

Are there any other configuration that i have to do when i have multiple API’s and database base connection. Each API has access to only 1 Database connection and i was able to test it by using login service of different API.

1 Like