I am currently using Refit and have been handling my auth stuff in an AuthenticationService where I set my Refit settings to have AuthorizationHeaderValueGetter use my AuthenticationService.GetAuthenticationToken() to get my access_token. The logic inside my GetAuthenticationToken() method checks the token expiration and will attempt to use the refresh_token to get a new access_token if it is expired. If all fails it will show the login screen of my app.
My test group has reported that they are asked to login frequently so I feel like there is something not working optimally in my design.
Am I doing too much in the AuthorizationHeaderValueGetter?
Should I be doing this in a DelegatingHandler where I can resubmit the api request after getting a new access_token?
I have background fetch stuff that happens in my app so I need to be able to have the refresh_token automatically get a new access_token during the background process.