Class AttributeQueryClaimsHandler

java.lang.Object
org.codice.ddf.security.claims.attributequery.common.AttributeQueryClaimsHandler
All Implemented Interfaces:
ddf.security.claims.ClaimsHandler

public class AttributeQueryClaimsHandler extends Object implements ddf.security.claims.ClaimsHandler
  • Field Details

    • ERROR_RETRIEVING_ATTRIBUTES

      protected static final String ERROR_RETRIEVING_ATTRIBUTES
      See Also:
    • simpleSign

      protected ddf.security.samlp.impl.SimpleSign simpleSign
    • externalAttributeStoreUrl

      protected String externalAttributeStoreUrl
    • issuer

      protected String issuer
    • destination

      protected String destination
  • Constructor Details

    • AttributeQueryClaimsHandler

      public AttributeQueryClaimsHandler()
  • Method Details

    • retrieveClaims

      public ddf.security.claims.ClaimsCollection retrieveClaims(ddf.security.claims.ClaimsParameters parameters)
      Retrieves claims from the external attribute store.
      Specified by:
      retrieveClaims in interface ddf.security.claims.ClaimsHandler
      Parameters:
      parameters - The subject to get claims for.
      Returns:
      The collection of claims or an empty collection if there are no security claims.
      Throws:
      URISyntaxException
    • getNameId

      protected String getNameId(Principal principal)
      Retrieve the name from the principal.
      Parameters:
      principal - of the user.
      Returns:
      CN of the user.
    • getAttributes

      protected ddf.security.claims.ClaimsCollection getAttributes(String nameId) throws URISyntaxException
      Gets the attributes for the supplied user from the external attribute store. Returns null if the AttributeQueryClient is null.
      Parameters:
      nameId - used for the request.
      Returns:
      The collection of attributes retrieved from the external attribute store.
      Throws:
      URISyntaxException
    • createClaims

      protected ddf.security.claims.ClaimsCollection createClaims(ddf.security.claims.ClaimsCollection claimsCollection, org.opensaml.saml.saml2.core.Assertion assertion)
      Creates claims from the extracted attributes.
      Parameters:
      claimsCollection - The collection of claims.
      assertion - Assertion from the response.
      Returns:
      The collection of claims.
      Throws:
      URISyntaxException
    • createSingleValuedClaim

      protected ddf.security.claims.Claim createSingleValuedClaim(String claimType, String claimValue)
      Creates a single valued claim.
      Parameters:
      claimType - The claim type.
      claimValue - The claim value.
      Returns:
      The claim.
      Throws:
      URISyntaxException
    • createAttributeQueryClient

      protected AttributeQueryClient createAttributeQueryClient(ddf.security.samlp.impl.SimpleSign simpleSign, String externalAttributeStoreUrl, String issuer, String destination)
      Creates a client to interface with an external attribute store via an AttributeQuery request.
      Parameters:
      simpleSign - to create signature for request
      externalAttributeStoreUrl - endpoint of external web service
      issuer - of request
      destination - of request
      Returns:
      AttributeQueryClient
    • createService

      protected final javax.xml.ws.Service createService()
      Creates a dynamic service from the provided wsdl location.
    • createDispatcher

      protected javax.xml.ws.Dispatch<StreamSource> createDispatcher(javax.xml.ws.Service service)
      Creates a dispatcher for dispatching requests.
    • setSignaturePropertiesLocation

      public void setSignaturePropertiesLocation(String signaturePropertiesLocation)
    • setEncryptionPropertiesLocation

      public void setEncryptionPropertiesLocation(String encryptionPropertiesLocation)
    • setWsdlLocation

      public void setWsdlLocation(String wsdlLocation)
    • setServiceName

      public void setServiceName(String serviceName)
    • setPortName

      public void setPortName(String portName)
    • setSimpleSign

      public void setSimpleSign(ddf.security.samlp.impl.SimpleSign simpleSign)
    • setExternalAttributeStoreUrl

      public void setExternalAttributeStoreUrl(String externalAttributeStoreUrl)
    • setIssuer

      public void setIssuer(String issuer)
    • setDestination

      public void setDestination(String destination)
    • setAttributeMapLocation

      public void setAttributeMapLocation(String attributeMapLocation)
    • setSupportedClaims

      public void setSupportedClaims(List<String> supportedClaims)
    • setSecurityLogger

      public void setSecurityLogger(ddf.security.audit.SecurityLogger securityLogger)