Package org.oa4mp.client.api.loader
Class AbstractClientLoader<T extends ClientEnvironment>
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.util.LoggingConfigLoader<T>
-
- org.oa4mp.delegation.common.servlet.DBConfigLoader<T>
-
- org.oa4mp.client.api.loader.AbstractClientLoader<T>
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.util.ConfigurationLoader<T>,edu.uiuc.ncsa.security.core.Version,Serializable,ClientLoaderInterface<T>
public abstract class AbstractClientLoader<T extends ClientEnvironment> extends DBConfigLoader<T> implements ClientLoaderInterface<T>
Top-level class for client loader that creates asset store and controls which classes are instantiated for the client.Created by Jeff Gaynor
on 11/25/13 at 1:12 PM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringASSET_ENDPOINTprotected javax.inject.Provider<AssetStore>assetStoreProviderstatic longdefaultCertLifetimestatic longdefaultMaxAssetLifetimeprotected javax.inject.Provider<DelegationService>dsp-
Fields inherited from class org.oa4mp.delegation.common.servlet.DBConfigLoader
derbyConnectionPoolProvider
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractClientLoader(org.apache.commons.configuration.tree.ConfigurationNode node)protectedAbstractClientLoader(org.apache.commons.configuration.tree.ConfigurationNode node, edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckProtocol(String b)Fix for OAUTH-107.protected URIcheckURI(String uri, String componentName)Checks the uri.edu.uiuc.ncsa.security.servlet.ServiceClientcreateServiceClient(URI host)protected URIcreateServiceURI(String foundURI, String endpoint, String wellKnownEntry)Creates the service URI.protected URIcreateServiceURIOLD(String foundURI, String baseUri, String serviceEndpoint)Checks if there is a found uri in the configuration, i.e., an override to whatever the standard is.URIgetAccessTokenURI()abstract AssetProvidergetAssetProvider()javax.inject.Provider<AssetStore>getAssetStoreProvider()URIgetAssetURI()URIgetAuthorizeURI()URIgetCallback()longgetCertLifetime()protected StringgetCfgValue(String key)This takes a key and returns the value of the node associated with that key.protected abstract javax.inject.Provider<DelegationService>getDSP()StringgetId()URIgetIssuer()longgetKeypairLifetime()longgetMaxAssetLifetime()StringgetServiceURI()StringgetSkin()edu.uiuc.ncsa.security.util.ssl.SSLConfigurationgetSSLConfiguration()edu.uiuc.ncsa.security.servlet.ServiceClientgetWellKnownClient()net.sf.json.JSONObjectgetWellKnownConfiguration()The well-known page from the server.StringgetWellKnownString(String key)Get the given value from the given key on the well-known page.StringgetWellKnownURI()ObjectgetWellKnownValue(String key)Get a value form the well-known configuration which may be a JSON or other object.booleanisEnableAssetCleanup()Tload()-
Methods inherited from class org.oa4mp.delegation.common.servlet.DBConfigLoader
getDerbyConnectionPoolProvider, getDerbyConnectionPoolProvider, getMariaDBConnectionPoolProvider, getMariaDBConnectionPoolProvider, getMySQLConnectionPoolProvider, getMySQLConnectionPoolProvider, getPgConnectionPoolProvider, getPgConnectionPoolProvider, isDefaultStoreDisabled
-
Methods inherited from class edu.uiuc.ncsa.security.core.util.LoggingConfigLoader
debug, getDebugger, getLoggerProvider, getMyLogger, getVersionString, info, setLoggerProvider, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.oa4mp.client.api.ClientLoaderInterface
getAdditionalParameters, getDeviceAuthorizationURI, getKeys, getKID, getRFC7009Endpoint, getRFC7662Endpoint, getScopes, getSecret, getServiceProvider, getUIURI, isOIDCEnabled
-
-
-
-
Field Detail
-
ASSET_ENDPOINT
public static final String ASSET_ENDPOINT
- See Also:
- Constant Field Values
-
defaultCertLifetime
public static final long defaultCertLifetime
- See Also:
- Constant Field Values
-
defaultMaxAssetLifetime
public static final long defaultMaxAssetLifetime
- See Also:
- Constant Field Values
-
assetStoreProvider
protected javax.inject.Provider<AssetStore> assetStoreProvider
-
dsp
protected javax.inject.Provider<DelegationService> dsp
-
-
Constructor Detail
-
AbstractClientLoader
protected AbstractClientLoader(org.apache.commons.configuration.tree.ConfigurationNode node)
-
AbstractClientLoader
protected AbstractClientLoader(org.apache.commons.configuration.tree.ConfigurationNode node, edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger)
-
-
Method Detail
-
getAssetProvider
public abstract AssetProvider getAssetProvider()
-
getAssetStoreProvider
public javax.inject.Provider<AssetStore> getAssetStoreProvider()
- Specified by:
getAssetStoreProviderin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getDSP
protected abstract javax.inject.Provider<DelegationService> getDSP()
-
checkURI
protected URI checkURI(String uri, String componentName)
Checks the uri. The componentName is simply used for a more readable error messages if the uri is trivial or there is some syntax error with it.- Parameters:
uri-componentName-- Returns:
-
getCfgValue
protected String getCfgValue(String key)
This takes a key and returns the value of the node associated with that key. Returns null if no such value.- Parameters:
key-- Returns:
-
getSkin
public String getSkin()
- Specified by:
getSkinin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getKeypairLifetime
public long getKeypairLifetime()
- Specified by:
getKeypairLifetimein interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getMaxAssetLifetime
public long getMaxAssetLifetime()
- Specified by:
getMaxAssetLifetimein interfaceClientLoaderInterface<T extends ClientEnvironment>
-
isEnableAssetCleanup
public boolean isEnableAssetCleanup()
- Specified by:
isEnableAssetCleanupin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
createServiceURIOLD
protected URI createServiceURIOLD(String foundURI, String baseUri, String serviceEndpoint)
Checks if there is a found uri in the configuration, i.e., an override to whatever the standard is. If so, check that and use it, if not, try and construct the service endpoint from the base uri and the default serviceEndpoint.- Parameters:
foundURI-baseUri-serviceEndpoint-- Returns:
-
createServiceURI
protected URI createServiceURI(String foundURI, String endpoint, String wellKnownEntry)
Creates the service URI. This takes- The tag in the configuration file
- The default endpoint name (used to construct error messages)
- The key in the well-known page to get the value from.
- Parameters:
foundURI-endpoint-wellKnownEntry-- Returns:
-
getCertLifetime
public long getCertLifetime()
- Specified by:
getCertLifetimein interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getId
public String getId()
- Specified by:
getIdin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getCallback
public URI getCallback()
- Specified by:
getCallbackin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
checkProtocol
protected void checkProtocol(String b)
Fix for OAUTH-107. Check that the protocols are indeed https as per spec at client loading rather than wait for a much later error from a server possibly trying to do a redirect. It is ok for the argument to be null, since that just means that a (correct) address will be created. This is to find mis-specified service addresses.- Parameters:
b-
-
getServiceURI
public String getServiceURI()
- Specified by:
getServiceURIin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getWellKnownURI
public String getWellKnownURI()
- Specified by:
getWellKnownURIin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getAccessTokenURI
public URI getAccessTokenURI()
- Specified by:
getAccessTokenURIin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getAssetURI
public URI getAssetURI()
- Specified by:
getAssetURIin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getIssuer
public URI getIssuer()
- Specified by:
getIssuerin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
getAuthorizeURI
public URI getAuthorizeURI()
- Specified by:
getAuthorizeURIin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
load
public T load()
- Specified by:
loadin interfaceedu.uiuc.ncsa.security.core.util.ConfigurationLoader<T extends ClientEnvironment>
-
getSSLConfiguration
public edu.uiuc.ncsa.security.util.ssl.SSLConfiguration getSSLConfiguration()
- Specified by:
getSSLConfigurationin interfaceClientLoaderInterface<T extends ClientEnvironment>
-
createServiceClient
public edu.uiuc.ncsa.security.servlet.ServiceClient createServiceClient(URI host)
-
getWellKnownClient
public edu.uiuc.ncsa.security.servlet.ServiceClient getWellKnownClient()
-
getWellKnownString
public String getWellKnownString(String key)
Get the given value from the given key on the well-known page. This just return strings. If there is no such value, a null is returned. If the response is incorrect, an exception is thrown.- Parameters:
key-- Returns:
-
getWellKnownValue
public Object getWellKnownValue(String key)
Get a value form the well-known configuration which may be a JSON or other object. You have to process it once you have it.- Parameters:
key-- Returns:
-
getWellKnownConfiguration
public net.sf.json.JSONObject getWellKnownConfiguration()
The well-known page from the server. Cache this or every call for a configuration value can require a trip to the server. The well-known page should rarely change, so this is completely reasonable.- Returns:
-
-