I'm generating token in the login time
var identityService = await DiscoveryClient.GetAsync("http://localhost:5000");
// request token
var tokenClient = new TokenClient(identityService.TokenEndpoint, "ro.client", "secret");
tokenResponse = await tokenClient.RequestResourceOwnerPasswordAsync(user.UserName, model.Password, "api1");
and store the local storage.
client-side access the API method add the headers
headers.append('Authorization', 'Bearer ' + token);
headers.append('Content-Type', 'application/json');
headers.append('Accept', 'application/json');
const options = { method: 'POST', headers, body: JSON.stringify(data) };
Its working good on the web. After expiring controller return unauthorize.
But I'not needed to expire in the token (refresh the token) in a mobile app. So how to refresh that token in mobile? any headers add for refresh the token?