public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static org.opensaml.saml2.core.NameID |
buildNameID(String nameIdFormat,
String subject)
Build NameID object given name ID format
|
static org.opensaml.saml2.core.NameIDPolicy |
buildNameIDPolicy(String nameIdPolicy)
Build NameIDPolicy object given name ID policy format
|
static org.opensaml.xml.XMLObject |
buildXMLObject(QName objectQName) |
static String |
createID()
Generates a unique Id for Authentication Requests
|
static String |
decode(String encodedStr)
Decoding and deflating the encoded AuthReq
|
static void |
doBootstrap()
This method is used to initialize the OpenSAML2 library.
|
static String |
encode(String xmlString)
Encoding the response
|
static String |
getDomainName(org.opensaml.xml.XMLObject samlObject) |
static DocumentBuilderFactory |
getSecuredDocumentBuilder()
Create DocumentBuilderFactory with the XXE prevention measurements
|
static String |
marshall(org.opensaml.xml.XMLObject xmlObject)
Serializing a SAML2 object into a String
|
static String |
processAcsUrl(String acsUrl)
Replaces the ${} in url with system properties and returns
|
static org.opensaml.xml.XMLObject |
unmarshall(String authReqStr)
Constructing the XMLObject Object from a String
|
static boolean |
validateAssertionSignature(org.opensaml.saml2.core.Response resp,
String keyStoreName,
String keyStorePassword,
String alias,
int tenantId,
String tenantDomain) |
static boolean |
validateAssertionValidityPeriod(org.opensaml.saml2.core.Response resp,
Properties prop)
Validates the 'Not Before' and 'Not On Or After' conditions of the SAML Assertion
|
static boolean |
validateAudienceRestriction(org.opensaml.saml2.core.Response resp,
Properties properties)
Validate the AudienceRestriction of SAML2 Response
|
static boolean |
validateSignature(org.opensaml.saml2.core.impl.StatusResponseTypeImpl resp,
String keyStoreName,
String keyStorePassword,
String alias,
int tenantId,
String tenantDomain)
This method validates the signature of the SAML Response.
|
public static void doBootstrap()
public static org.opensaml.xml.XMLObject buildXMLObject(QName objectQName) throws Exception
Exceptionpublic static String createID()
public static org.opensaml.xml.XMLObject unmarshall(String authReqStr) throws Exception
authReqStr - Exceptionpublic static String marshall(org.opensaml.xml.XMLObject xmlObject) throws Exception
xmlObject - object that needs to serialized.Exceptionpublic static String encode(String xmlString)
xmlString - String to be encodedpublic static String decode(String encodedStr) throws Exception
encodedStr - encoded AuthReqExceptionpublic static boolean validateSignature(org.opensaml.saml2.core.impl.StatusResponseTypeImpl resp,
String keyStoreName,
String keyStorePassword,
String alias,
int tenantId,
String tenantDomain)
resp - SAML Responsepublic static boolean validateAssertionSignature(org.opensaml.saml2.core.Response resp,
String keyStoreName,
String keyStorePassword,
String alias,
int tenantId,
String tenantDomain)
public static boolean validateAssertionValidityPeriod(org.opensaml.saml2.core.Response resp,
Properties prop)
resp - SAML Responsepublic static boolean validateAudienceRestriction(org.opensaml.saml2.core.Response resp,
Properties properties)
resp - SAML responsepublic static String getDomainName(org.opensaml.xml.XMLObject samlObject)
public static DocumentBuilderFactory getSecuredDocumentBuilder()
public static org.opensaml.saml2.core.NameIDPolicy buildNameIDPolicy(String nameIdPolicy)
nameIdPolicy - Name ID policy formatpublic static org.opensaml.saml2.core.NameID buildNameID(String nameIdFormat, String subject)
nameIdFormat - Name ID formatsubject - SubjectCopyright © 2018 WSO2 Inc. All rights reserved.