From 5c71e43eb02e25d257dcaed6910c5ee8013c2fa0 Mon Sep 17 00:00:00 2001 From: Simone Cottini Date: Mon, 11 Mar 2024 08:52:46 +0100 Subject: [PATCH] Update readme explaining key construction (#212) --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2560771..9337e9a 100644 --- a/README.md +++ b/README.md @@ -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" ] ``` @@ -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: