Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLATFORM-1586]: Update auth0_ex doc explaining redis key construction #212

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ config :prima_auth0_ex, :clients, default_client: [
# Credentials on Auth0
client_id: "",
client_secret: "",
# Namespace for tokens of this client on the shared cache. Should be unique per client
# Namespace for tokens of this client on the shared cache. Should be unique per client.
cache_namespace: "my-client"
]
```
Expand Down Expand Up @@ -128,6 +128,15 @@ config :prima_auth0_ex, :redis,
ssl_allow_wildcard_certificates: false
```

Keep in mind that when saving the token, its value will be stored within a key generated through interpolation,
structured as `prima_auth0_ex_tokens:${cache_namespace}:${requested_audience}`. It's important to note that this
implementation detail could potentially be subject to change in the future.

In case a particular need emerges, you can develop a personalized iteration of the `EncryptedRedisTokenCache` by directly
applying the `PrimaAuth0Ex.TokenCache` behavior. This involves substituting the
`config :prima_auth0_ex, :token_cache, EncryptedRedisTokenCache` configuration with the newly crafted custom TokenCache
implementation.

#### Operational requirements

To cache tokens on Redis you'll need to generate a `cache_encryption_key`. This can be done either by running `mix keygen` or by using the following snippet:
Expand Down
Loading