* To prevent a secret from leaking across realms, you mey want to isolate or limit what secrets can be retrieved by a realm.
In that case, your provider should take into account the realm name when looking up secrets, for example by prefixing
entries with the realm name. For example, an expression `${vault.secret-id}` would then evaluate generally
to different values of a secret `secret-id`, depending on whether it was used in a realm _A_ or realm _B_.
To differentiate between realms, the realm needs to be passed to the created `VaultProvider` instance from
`VaultProviderFactory.create()` method where it is available from its the `KeycloakSession` parameter.
* The vault provider needs to implement a single method `obtainSecret` that returns a `VaultRawSecret` for the given secret name. That class holds the representation of the secret either in `byte[]` or `ByteBuffer` and is expected to convert between the two upon demand. Note that this buffer would be discarded after usage as explained below.
For details on how to package and deploy a custom provider refer to the <<_providers,Service Provider Interfaces>> chapter.
=== Consuming values from vault
The vault contains sensitive data and {project_name} treats the secrets accordingly. When accessing a secret, the secret is obtained from the vault and retained in JVM memory only for the necessary time. Then all possible attempts to discard its content from JVM memory is done. This is achieved by using the vault secrets only within `try`-with-resources statement as outlined below: