Facilities TokenStore Cache

NuGet packageOwin.Framework.Facilities.TokenStore.Cache
GitHub sourceOwinFramework.Facilities.TokenStore.Cache

Home |  Readme

The OwinFramework.Facilities.TokenStore.Cache Project

This package provides an implementation of the ITokenStore interface using whatever implementation of ICache is configured in your application.

To make this implementation available to other packages that need this interface you just need to add the NuGet package to the project - that's it, there is nothing else to do.

Default Configuration

The configuration below is the configuration you will get by default if you do not provide a configuration for this package.

   "owinFramework": {
      "facility": {
         "tokenStore.Cache": {
            "lifetime": "01:00:00",
            "cachePrefix": "/tokens/"
The "cachePrefix" value is passed to the ICache interface where it can be used to configure the caching behaviour.

Token rules

This package implements the following token rules:

  • Only tokens that have been created are valid. Checking a random token string will always result in a 'not valid' response.
  • Tokens are no longer valid after they have expired.
  • Tokens are only valid for the purpose, identity and token type they were created with.
  • If a token is created with no purpose then it is valid for any purpose.
  • If a token is created with no identity than it is valid for all identities.
  • It is not valid to create a token with no token type.
  • All token types are treated identically.
  • The token itself is case sensitive.
  • The token type, purpose and identity are case insentitive.
  • When tokens are deleted they are deleted from the cache and immediately become invalid.