Hello, I’m trying to update my request with the credential.authorize() function used here:
I’m using it like this, and when I print out my request headers, it shows an Authorization header with a token. For some reason, this token is not accepted by our API:
func prepareGETRequest(_ urlString: String) async -> URLRequest {
let url = URL(string: urlString)
var request = URLRequest(url: url!)
if let credential = Credential.default {
await credential.authorize(&request)
}
return request
}
When I manually attach our access token, it works, but it would be nice to make use of the convenience function to refresh our token automatically. Why might this refreshed token not be accepted by our API?