Package com.sun.identity.saml
Class SAMLClient
- java.lang.Object
-
- com.sun.identity.saml.SAMLClient
-
public class SAMLClient extends Object
The classSAMLClient
provides interfaces to do Web and POST profile as specified by SAML specification. It also provides methods to get Assertions based on Artifacts.
-
-
Constructor Summary
Constructors Constructor Description SAMLClient()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List
artifactQueryHandler(String[] arti, String connecto)
This method is designed to get a list of assertion based on the inputAssertionArtifact
(s).static void
doWebArtifact(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String target)
This method is designed to do the SAML web-browser profile with Artifact.static void
doWebPOST(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String target)
This method is designed to do the SAML web-browser POST profile.static Assertion
getAssertionByArtifact(AssertionArtifact artifact)
This method returns the Assertion for the corresponding artifact.static Assertion
getAssertionByArtifact(String artifact)
This method returns the Assertion for the corresponding artifact.static boolean
setLocalFlag(URL url)
-
-
-
Method Detail
-
doWebArtifact
public static void doWebArtifact(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String target) throws IOException, SAMLException
This method is designed to do the SAML web-browser profile with Artifact. Once the browser (user) authenticated to OpenAM, it can call this method to complete the single sign on to the target host and be redirected to the specified target site.- Parameters:
request
- HTTP Servlet Requestresponse
- HTTP Servlet Responsetarget
- A String representing the target URL- Throws:
IOException
- if an input or output exception occurs when redirecting to serviceURL
SAMLException
- if SAML error occurs during the process
-
doWebPOST
public static void doWebPOST(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String target) throws IOException, SAMLException
This method is designed to do the SAML web-browser POST profile. Once the browser (user) authenticated to OpenAM, it can call this method to complete the single sign on to the target host and be redirected to the target site.- Parameters:
request
- HTTP Servlet Requestresponse
- HTTP Servlet Responsetarget
- A String representing the target URL- Throws:
IOException
- if an input or output exception occurs when redirecting to serviceURL
SAMLException
- if SAML error occurs during the process
-
getAssertionByArtifact
public static Assertion getAssertionByArtifact(AssertionArtifact artifact) throws IOException, SAMLException
This method returns the Assertion for the corresponding artifact. It sends anArtifactQuery
SAML message to the destination identified by the source ID in the artifact and returns the Assertion contained in the SAML response message.- Parameters:
artifact
- AnAssertionArtifact
representing the artifact- Returns:
- An Assertion corresponding to the artifact
- Throws:
IOException
- if an input or output exception occurs when connecting to SAML serviceURL
SAMLException
- if SAML error occurs during the process
-
getAssertionByArtifact
public static Assertion getAssertionByArtifact(String artifact) throws IOException, SAMLException
This method returns the Assertion for the corresponding artifact. It sends anArtifactQuery
SAML message to the destination identified by the source ID in the artifact and returns the Assertion contained in the SAML response message.- Parameters:
artifact
- A String representing the artifact- Returns:
- An Assertion corresponding to the artifact
- Throws:
IOException
- if an input or output exception occurs when connecting to SAML serviceURL
SAMLException
- if SAML error occurs during the process
-
setLocalFlag
public static boolean setLocalFlag(URL url)
-
artifactQueryHandler
public static List artifactQueryHandler(String[] arti, String connecto) throws IOException, SAMLException
This method is designed to get a list of assertion based on the inputAssertionArtifact
(s).- Parameters:
arti
- An array of String- Returns:
- a List object representing a list of Assertions
- Throws:
IOException
- if an input or output exception occurs when connecting to SAML serviceURL
SAMLException
- if SAML error occurs during the process
-
-