Package com.sun.identity.saml2.profile
Class AttributeQueryUtil
- java.lang.Object
-
- com.sun.identity.saml2.profile.AttributeQueryUtil
-
public class AttributeQueryUtil extends Object
This class provides methods to send or processAttributeQuery.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Map<String,String>getAttributeMapForFedlet(String spEntityID, String idpEntityID, String nameIDValue, List<String> attrsList, String attrQueryProfileAlias, String subjectDN)static StringgetAttributeQueryProfile(String attrQueryProfileAlias)Converts attribute query profile alias to attribute query profile.static Map<String,Set<String>>getAttributesForFedlet(String spEntityID, String idpEntityID, String nameIDValue, List<String> attrsList, String attrQueryProfileAlias, String subjectDN)Sends the AttributeQuery to specified attribute authority, validates the response and returns the attribute mapMap<String, Set<String>>to the Fedletstatic StringgetIdentity(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)static StringgetIdentityFromDataStoreX509Subject(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)static ListgetUserAttributes(String userId, AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)static ResponseprocessAttributeQuery(AttributeQuery attrQuery, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String attrAuthorityEntityID, String realm, String attrQueryProfileAlias)Processes theAttributeQuerycoming from a requester.static voidsendAttributeQuery(AttributeQuery attrQuery, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String attrAuthorityEntityID, String realm, String attrQueryProfile, String attrProfile, String binding)Sends theAttributeQueryto specified attribute authority and returnsResponsecoming from the attribute authority.static ResponsesendAttributeQuery(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm, String attrQueryProfile, String attrProfile, String binding)Sends theAttributeQueryto specified attribute authority and returnsResponsecoming from the attribute authority.static voidsignResponse(Response response, String attrAuthorityEntityID, String realm, boolean includeCert)static voidvalidateEntityRequester(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)static voidverifyAttrQuerySignature(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)Checks if the attribute query signature is valid.
-
-
-
Method Detail
-
sendAttributeQuery
public static Response sendAttributeQuery(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm, String attrQueryProfile, String attrProfile, String binding) throws SAML2Exception
Sends theAttributeQueryto specified attribute authority and returnsResponsecoming from the attribute authority.- Parameters:
attrQuery- theAttributeQueryobjectattrAuthorityEntityID- entity ID of attribute authorityrealm- the realm of hosted entityattrQueryProfile- the attribute query profile or null to ignoreattrProfile- the attribute profilebinding- the binding- Returns:
- the
Responseobject - Throws:
SAML2Exception- if the operation is not successful
-
sendAttributeQuery
public static void sendAttributeQuery(AttributeQuery attrQuery, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String attrAuthorityEntityID, String realm, String attrQueryProfile, String attrProfile, String binding) throws SAML2Exception
Sends theAttributeQueryto specified attribute authority and returnsResponsecoming from the attribute authority.- Parameters:
attrQuery- theAttributeQueryobjectrequest- the HTTP Requestresponse- the HTTP ResponseattrAuthorityEntityID- entity ID of attribute authorityrealm- the realm of hosted entityattrQueryProfile- the attribute query profile or null to ignoreattrProfile- the attribute profilebinding- the binding- Throws:
SAML2Exception- if the operation is not successful
-
processAttributeQuery
public static Response processAttributeQuery(AttributeQuery attrQuery, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String attrAuthorityEntityID, String realm, String attrQueryProfileAlias) throws SAML2Exception
Processes theAttributeQuerycoming from a requester.- Parameters:
attrQuery- theAttributeQueryobjectrequest- theHttpServletRequestobjectresponse- theHttpServletResponseobjectattrAuthorityEntityID- entity ID of attribute authorityrealm- the realm of hosted entityattrQueryProfileAlias- the attribute query profile alias- Returns:
- the
Responseobject - Throws:
SAML2Exception- if the operation is not successful
-
getAttributeQueryProfile
public static String getAttributeQueryProfile(String attrQueryProfileAlias)
Converts attribute query profile alias to attribute query profile.- Parameters:
attrQueryProfileAlias- attribute query profile alias- Returns:
- attribute query profile
-
validateEntityRequester
public static void validateEntityRequester(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm) throws SAML2Exception
- Throws:
SAML2Exception
-
verifyAttrQuerySignature
public static void verifyAttrQuerySignature(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm) throws SAML2Exception
Checks if the attribute query signature is valid.- Parameters:
attrQuery- attribute queryattrAuthorityEntityID- entity ID of attribute authorityrealm- the realm of hosted entity- Throws:
SAML2Exception- if the attribute query signature is not valid.
-
getIdentityFromDataStoreX509Subject
public static String getIdentityFromDataStoreX509Subject(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm) throws SAML2Exception
- Throws:
SAML2Exception
-
getIdentity
public static String getIdentity(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm) throws SAML2Exception
- Throws:
SAML2Exception
-
getUserAttributes
public static List getUserAttributes(String userId, AttributeQuery attrQuery, String attrAuthorityEntityID, String realm) throws SAML2Exception
- Throws:
SAML2Exception
-
signResponse
public static void signResponse(Response response, String attrAuthorityEntityID, String realm, boolean includeCert) throws SAML2Exception
- Throws:
SAML2Exception
-
getAttributeMapForFedlet
public static Map<String,String> getAttributeMapForFedlet(String spEntityID, String idpEntityID, String nameIDValue, List<String> attrsList, String attrQueryProfileAlias, String subjectDN) throws SAML2Exception
Sends the AttributeQuery to specified attribute authority, validates the response and returns the attribute mapMap<String, String>to the Fedlet- Parameters:
spEntityID- SP entity IDidpEntityID- IDP entity IDnameIDValue- NameID valueattrsList- The list of attributes whose values need to be fetched from IDPattrQueryProfileAlias- Attribute Query Profile AliassubjectDN- Attribute name which contains X.509 subject DN- Returns:
- the
Mapobject - Throws:
SAML2Exception- if the operation is not successful
-
getAttributesForFedlet
public static Map<String,Set<String>> getAttributesForFedlet(String spEntityID, String idpEntityID, String nameIDValue, List<String> attrsList, String attrQueryProfileAlias, String subjectDN) throws SAML2Exception
Sends the AttributeQuery to specified attribute authority, validates the response and returns the attribute mapMap<String, Set<String>>to the Fedlet- Parameters:
spEntityID- SP entity IDidpEntityID- IDP entity IDnameIDValue- NameID valueattrsList- The list of attributes whose values need to be fetched from IDPattrQueryProfileAlias- Attribute Query Profile AliassubjectDN- Attribute name which contains X.509 subject DN- Returns:
- the
Mapobject - Throws:
SAML2Exception- if the operation is not successful
-
-