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 String
getAttributeQueryProfile(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 String
getIdentity(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)
static String
getIdentityFromDataStoreX509Subject(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)
static List
getUserAttributes(String userId, AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)
static Response
processAttributeQuery(AttributeQuery attrQuery, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String attrAuthorityEntityID, String realm, String attrQueryProfileAlias)
Processes theAttributeQuery
coming from a requester.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)
Sends theAttributeQuery
to specified attribute authority and returnsResponse
coming from the attribute authority.static Response
sendAttributeQuery(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm, String attrQueryProfile, String attrProfile, String binding)
Sends theAttributeQuery
to specified attribute authority and returnsResponse
coming from the attribute authority.static void
signResponse(Response response, String attrAuthorityEntityID, String realm, boolean includeCert)
static void
validateEntityRequester(AttributeQuery attrQuery, String attrAuthorityEntityID, String realm)
static void
verifyAttrQuerySignature(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 theAttributeQuery
to specified attribute authority and returnsResponse
coming from the attribute authority.- Parameters:
attrQuery
- theAttributeQuery
objectattrAuthorityEntityID
- 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
Response
object - 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 theAttributeQuery
to specified attribute authority and returnsResponse
coming from the attribute authority.- Parameters:
attrQuery
- theAttributeQuery
objectrequest
- 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 theAttributeQuery
coming from a requester.- Parameters:
attrQuery
- theAttributeQuery
objectrequest
- theHttpServletRequest
objectresponse
- theHttpServletResponse
objectattrAuthorityEntityID
- entity ID of attribute authorityrealm
- the realm of hosted entityattrQueryProfileAlias
- the attribute query profile alias- Returns:
- the
Response
object - 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
Map
object - 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
Map
object - Throws:
SAML2Exception
- if the operation is not successful
-
-