Class AuthenticationQuery


  • public class AuthenticationQuery
    extends SubjectQuery
    This concrete class extends from the abstract base class SubjectQuery. It represents the query for an authentication assertion. It corresponds to the <samlp:AuthenticationQueryType> in the SAML protocol schema.
    • Field Detail

      • authMethod

        protected String authMethod
    • Constructor Detail

      • AuthenticationQuery

        protected AuthenticationQuery()
        Default Constructor
      • AuthenticationQuery

        public AuthenticationQuery​(Element element)
                            throws SAMLException
        This constructor is used to build an Authentication Query from a DOM tree that was built from the XML string.
        Parameters:
        element - the DOM tree element which contains an Authentication Query.
        Throws:
        SAMLException - when an error occurs.
      • AuthenticationQuery

        public AuthenticationQuery​(Subject subject,
                                   String authMethod)
                            throws SAMLException
        Constructor.
        Parameters:
        subject - the Subject of the AuthenticationQuery.
        authMethod - the AuthenticationMethod in string format. It could be null.
        Throws:
        SAMLException
      • AuthenticationQuery

        public AuthenticationQuery​(Subject subject)
                            throws SAMLException
        Constructor.
        Parameters:
        subject - The Subject of the AuthenticationQuery.
        Throws:
        SAMLException
    • Method Detail

      • getAuthenticationMethod

        public String getAuthenticationMethod()
        Returns the AuthenticationMethod.
        Returns:
        AuthenticationMethod in string format; or null if there is none.
      • getQueryType

        public int getQueryType()
        Returns the type of this query.
        Specified by:
        getQueryType in class Query
        Returns:
        Query.AUTHENTICATION_QUERY.
      • toString

        public String toString()
        Translates the AuthenticationQuery to an XML document String based on the AuthenticationQuery schema described above.
        Overrides:
        toString in class Object
        Returns:
        An XML String representing the AuthenticationQuery.
      • toString

        public String toString​(boolean includeNS,
                               boolean declareNS)
        Returns a String representation of the element.
        Specified by:
        toString in class Query
        Parameters:
        includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
        declareNS - Determines whether or not the namespace is declared within the Element.
        Returns:
        A string containing the valid XML for this element