This article and this StackOverflow answer say that the DataProtectorTokenProvider
needs to be a static class so that it can recognise tokens generated by itself earlier. I found the same behaviour that it doesn't work when it's instantiated again for verifying the token.
I believe this is not an optimal solution for distributed environments, e.g. Azure. If the token is generated by an instance which is deallocated afterwards and another instance has to deal with the token verification then it will fail, and there is no guarantee it will ever succeed.
Is there a boilerplate implementation to make it stateless, e.g. store the token in Redis Cache or SQL?