Class AbstractOA4MPService

  • Direct Known Subclasses:
    OA4MPService

    public abstract class AbstractOA4MPService
    extends Object

    Created by Jeff Gaynor
    on 11/26/13 at 11:27 AM

    • Field Detail

      • 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()
      • preRequestCert

        public abstract void preRequestCert​(Asset asset,
                                            Map parameters)
      • preGetCert

        public abstract void preGetCert​(Asset asset,
                                        Map parameters)
      • 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 the requestCert(java.util.Map) call.
        Returns:
      • requestCert

        public OA4MPResponse requestCert​(edu.uiuc.ncsa.security.core.Identifier identifier)
        A convenience method to do the requestCert() call and create an asset with the given identifier. This will throw an exception if there is no asset store configured.
        Parameters:
        identifier -
        Returns:
      • 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()
      • getCert

        public AssetResponse getCert​(String tempToken,
                                     String verifier)
        Retrieve the certificate chain from the server. This is done after the requestCert() and user authorization.
        Parameters:
        tempToken -
        verifier -
        Returns:
      • getCert

        public AssetResponse getCert​(String tempToken,
                                     String verifier,
                                     edu.uiuc.ncsa.security.core.Identifier identifier)
        Performs the getCert(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: