Class AbstractOA4MPService
- java.lang.Object
-
- org.oa4mp.client.api.AbstractOA4MPService
-
- Direct Known Subclasses:
OA4MPService
public abstract class AbstractOA4MPService extends Object
Created by Jeff Gaynor
on 11/26/13 at 11:27 AM
-
-
Field Summary
Fields Modifier and Type Field Description protected String
BASE64_URI_CAPUT
Used in making a consistent base 64-based uri from a string.static String
SKIN_PARAMETER
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOA4MPService(ClientEnvironment environment)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Map<String,String>
getAssetParameters(Asset asset)
This creates the parameter map for the certificate request.AssetProvider
getAssetProvider()
protected AssetStore
getAssetStore()
protected Map<String,String>
getATParameters(Asset asset, AuthorizationGrant ag, Verifier v)
This creates the parameter map for the access token request.protected AssetResponse
getCert(Asset asset, AuthorizationGrant ag, Verifier v)
Does the actual work getting the cert.AssetResponse
getCert(String tempToken, String verifier)
Retrieve the certificate chain from the server.AssetResponse
getCert(String tempToken, String verifier, edu.uiuc.ncsa.security.core.Identifier identifier)
Performs thegetCert(String, String)
call then updates the asset associated with the given identifier.ClientEnvironment
getEnvironment()
protected KeyPair
getNextKeyPair()
protected edu.uiuc.ncsa.security.core.Identifier
makeb64Uri(String x)
abstract void
postGetCert(Asset asset, AssetResponse assetResponse)
abstract void
postRequestCert(Asset asset, OA4MPResponse oa4MPResponse)
abstract void
preGetCert(Asset asset, Map parameters)
abstract void
preRequestCert(Asset asset, Map parameters)
OA4MPResponse
requestCert()
This will make the request with whatever defaults are in effect for the client.protected OA4MPResponse
requestCert(Asset asset, Map additionalParameters)
OA4MPResponse
requestCert(edu.uiuc.ncsa.security.core.Identifier identifier)
A convenience method to do therequestCert()
call and create an asset with the given identifier.OA4MPResponse
requestCert(edu.uiuc.ncsa.security.core.Identifier identifier, Map additionalParameters)
A convenience method that allows for a map of additional parameters.OA4MPResponse
requestCert(Map additionalParameters)
Request a certificate from the user portal.void
setAssetProvider(AssetProvider assetProvider)
-
-
-
Field Detail
-
SKIN_PARAMETER
public static final String SKIN_PARAMETER
- See Also:
- Constant Field Values
-
BASE64_URI_CAPUT
protected String BASE64_URI_CAPUT
Used in making a consistent base 64-based uri from a string.
-
-
Constructor Detail
-
AbstractOA4MPService
protected AbstractOA4MPService(ClientEnvironment environment)
-
-
Method Detail
-
getAssetStore
protected AssetStore getAssetStore()
-
getEnvironment
public ClientEnvironment getEnvironment()
-
postRequestCert
public abstract void postRequestCert(Asset asset, OA4MPResponse oa4MPResponse)
-
postGetCert
public abstract void postGetCert(Asset asset, AssetResponse assetResponse)
-
requestCert
public OA4MPResponse requestCert()
This will make the request with whatever defaults are in effect for the client. You can override these by supplying them as key-value pairs in therequestCert(java.util.Map)
call.- Returns:
-
requestCert
public OA4MPResponse requestCert(edu.uiuc.ncsa.security.core.Identifier identifier)
A convenience method to do therequestCert()
call and create an asset with the given identifier. This will throw an exception if there is no asset store configured.- Parameters:
identifier
-- Returns:
-
getAssetProvider
public AssetProvider getAssetProvider()
-
setAssetProvider
public void setAssetProvider(AssetProvider assetProvider)
-
requestCert
public OA4MPResponse requestCert(edu.uiuc.ncsa.security.core.Identifier identifier, Map additionalParameters)
A convenience method that allows for a map of additional parameters.- Parameters:
identifier
-additionalParameters
-- Returns:
-
requestCert
public OA4MPResponse requestCert(Map additionalParameters)
Request a certificate from the user portal. This will also generate the private key and cert request. These are not stored by this service. The additionalParameters argument are passed as key/value pairs in the initial request and are not otherwise processed.- Returns:
-
makeb64Uri
protected edu.uiuc.ncsa.security.core.Identifier makeb64Uri(String x)
-
getNextKeyPair
protected KeyPair getNextKeyPair()
-
requestCert
protected OA4MPResponse requestCert(Asset asset, Map additionalParameters)
-
getCert
public AssetResponse getCert(String tempToken, String verifier)
Retrieve the certificate chain from the server. This is done after therequestCert()
and user authorization.- Parameters:
tempToken
-verifier
-- Returns:
-
getCert
public AssetResponse getCert(String tempToken, String verifier, edu.uiuc.ncsa.security.core.Identifier identifier)
Performs thegetCert(String, String)
call then updates the asset associated with the given identifier. This throws an exception is there is no asset or if the asset store is not enabled.- Parameters:
tempToken
-verifier
-identifier
-- Returns:
-
getATParameters
protected Map<String,String> getATParameters(Asset asset, AuthorizationGrant ag, Verifier v)
This creates the parameter map for the access token request. Send along anything specific to the protocol in this map.- Parameters:
asset
-ag
-v
-- Returns:
-
getAssetParameters
protected Map<String,String> getAssetParameters(Asset asset)
This creates the parameter map for the certificate request. Send along anything specific to the protocol in this map.- Parameters:
asset
-- Returns:
-
getCert
protected AssetResponse getCert(Asset asset, AuthorizationGrant ag, Verifier v)
Does the actual work getting the cert.- Parameters:
asset
-ag
-v
-- Returns:
-
-