I am trying to refresh an access token:
const url = "http://localhost/auth/realms/myrealm/protocol/openid-connect/token"
const params = new URLSearchParams();
params.append('grant_type', 'refresh_token');
params.append('client_id', "web");
params.append('refresh_token', "eyJhbGci...");
const config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
};
require('axios').post(url, params, config).then(resp => {
console.log(resp.data)
}).catch(e => {
console.log(e.response.data)
console.log(e.response.status)
})
This output the following error:
{ error: 'invalid_grant', error_description: 'Token is not active' }
This is my client configuration:
For what is worth the same happens with curl