public class JwksManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
Constructor and Description |
---|
JwksManager(android.content.Context context,
org.aerogear.mobile.core.MobileCore mobileCore,
AuthServiceConfiguration authServiceConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
fetchJwks(KeycloakConfiguration keycloakConfiguration,
org.aerogear.mobile.core.Callback<org.jose4j.jwk.JsonWebKeySet> cb)
Call the remote endpoint to load the JWKS and save it locally.
|
boolean |
fetchJwksIfNeeded(KeycloakConfiguration keycloakConfiguration,
boolean forceFetch)
Fetch the JWKS from the server if necessary and save them locally.
|
org.jose4j.jwk.JsonWebKeySet |
load(KeycloakConfiguration keyCloakConfig)
Load the cached JWKS from the private storage of the app.
|
public static final java.lang.String TAG
public JwksManager(@NonNull android.content.Context context, @NonNull org.aerogear.mobile.core.MobileCore mobileCore, @NonNull AuthServiceConfiguration authServiceConfiguration)
public org.jose4j.jwk.JsonWebKeySet load(KeycloakConfiguration keyCloakConfig)
AuthServiceConfiguration.getMinTimeBetweenJwksRequests()
is
passed since the key set is requested last time.keyCloakConfig
- the configuration to use to load the JWKS objectpublic boolean fetchJwksIfNeeded(KeycloakConfiguration keycloakConfiguration, boolean forceFetch)
AuthServiceConfiguration.getMinTimeBetweenJwksRequests()
is passed since the key set
is requested last time.keycloakConfiguration
- the configuration of the keycloak serverforceFetch
- if set to true, the request will be trigger immediately.public void fetchJwks(@NonNull KeycloakConfiguration keycloakConfiguration, @Nullable org.aerogear.mobile.core.Callback<org.jose4j.jwk.JsonWebKeySet> cb)
keycloakConfiguration
- the configuration of the keycloak servercb
- the callback function to be invoked when the request is completed. Can be null.