Class HttpUserAuthenticator

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String authenticate​(java.lang.String socketId)
      Called when a user is to be authenticated.
      protected java.lang.RuntimeException authFailureException​(java.io.IOException e)  
      protected java.lang.RuntimeException authFailureException​(java.lang.String msg)  
      java.lang.Boolean isSSL()
      Identifies if the HTTP request will be sent over HTTPS.
      protected java.lang.String performAuthRequest()
      Performs an HTTP request to the endpoint provided on construction.
      void setHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
      Set additional headers to be sent as part of the request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpUserAuthenticator

        public HttpUserAuthenticator​(java.lang.String endPoint)
        Creates a new user authenticator.
        Parameters:
        endPoint - The endpoint to be called when authenticating.
      • HttpUserAuthenticator

        public HttpUserAuthenticator​(java.lang.String endPoint,
                                     ConnectionFactory connectionFactory)
        Creates a new user authenticator.
        Parameters:
        endPoint - The endpoint to be called when authenticating.
        connectionFactory - a custom connection factory to be used for building the connection
    • Method Detail

      • authFailureException

        protected java.lang.RuntimeException authFailureException​(java.lang.String msg)
      • authFailureException

        protected java.lang.RuntimeException authFailureException​(java.io.IOException e)
      • setHeaders

        public void setHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
        Set additional headers to be sent as part of the request.
        Parameters:
        headers - A map of headers
      • isSSL

        public java.lang.Boolean isSSL()
        Identifies if the HTTP request will be sent over HTTPS.
        Returns:
        true if the endpoint protocol is 'https'
      • performAuthRequest

        protected java.lang.String performAuthRequest()
        Performs an HTTP request to the endpoint provided on construction.

        The request shall include the headers and parameters provided by the connectionFactory.

        Child classes must provide the connection parameters to the connectionFactory before calling this method.

        Returns:
        HTTP request response body