'How to observe credential in AuthenticationInterceptor from Alamofire

I'm using AuthenticationInterceptor with a custom Authenticator to handle the token refresh.

Since we are migrating from an old network stack to Alamofire, I need to keep track of the credential property in AuthenticationInterceptor to feed that into the old network stack.

Is there anyway to observe the change of credential.

Unfortunately, AuthenticationInterceptor is not open for subclassing.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source