public DummyAdapterPresentation(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     this.request = request;
     DummyLogger.Log(string.Format("ServiceName: {0}, Uri: {1}, UserHostName: {2}, UserHostAddress: {3}", request.ServiceName, request.Url.AbsoluteUri, request.UserHostName, request.UserHostAddress));
     this.ex = ex;
     DummyLogger.Log(string.Format("ExternalAuthenticationException: {0}", ex.Message));
 }
Exemplo n.º 2
0
        public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
        {
            Debug.Caller = "OnError";

            //return new instance of IAdapterPresentationForm derived class
            return(new SmsPresentationFormPin(Debug));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Called on error and represents the authform with a error message
        /// </summary>
        /// <param name="request">the http request object</param>
        /// <param name="ex">exception message</param>
        /// <returns>new instance of IAdapterPresentationForm derived class</returns>
        public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
        {
            Log("OnError, ExternalAuthenticationException: " + ex.Message);
            var form = new AdapterPresentationForm();

            form.ErrorMessage = ex.Message;
            return(form);
        }
        public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
        {
            if (ex == null)
            {
                throw new ArgumentNullException(nameof(ex));
            }

            return(CreateAdapterPresentationOnError(String.Empty, ex));
        }
        /// <summary>
        /// Called whenever something goes wrong in either the BeginAuthentication
        /// TryEndAuthentication methods. Calls AdapterPresentation to display
        /// a nice message to the end user.
        /// </summary>
        /// <param name="request"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        public IAdapterPresentation OnError(System.Net.HttpListenerRequest request, ExternalAuthenticationException ex)
        {
            Logging.LogMessage(
                "An error occured authenticating a user." + Environment.NewLine + Environment.NewLine +
                "Username: "******"Error: " + ex.Message);

            return(new AdapterPresentation(ex.Message, true));
        }
        public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
        {
            /* The OnError method is called whenever something goes wrong in the authentication process.
             * To be more precise; if anything goes wrong in the BeginAuthentication or TryEndAuthentication methods of the authentication adapter,
             * and either of these methods throw an ExternalAuthenticationException, the OnError method is called.
             * This allows your adapter to capture the error and present a nice error message to the customer.
             *
             * Because we have to present a nice error message to the user, this method returns an instance of a class that implements IAdapterPresentation.
             * We've touched that interface before.
             * */

            return(new AdapterPresentation(string.Format("<p>{0}</p>", ex.Message), true));
        }
 public IAdapterPresentation OnError(System.Net.HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     return new SimplePINAdapterPresentation(ex.Message, true);
 }
 /// <summary>
 /// Called on error and represents the authform with a error message
 /// </summary>
 /// <param name="request">the http request object</param>
 /// <param name="ex">exception message</param>
 /// <returns>new instance of IAdapterPresentationForm derived class</returns>
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     return(new AdapterPresentationForm(true, message, uidefinition));
 }
 public UsernamePasswordPresentation(string username, ExternalAuthenticationException ex) : this(username)
 {
     _ex = ex;
 }
Exemplo n.º 10
0
 public IAdapterPresentation OnError(System.Net.HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     return(new AdapterPresentation(ex.Message, true));
 }
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     //return new instance of IAdapterPresentationForm derived class
     return(new AdapterPresentation());
 }
 /// <summary>
 /// Called when an error occurs.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="ex">The exception details.</param>
 /// <returns>The presentation form.</returns>
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     this.log.ErrorFormat("Error occured:{0}", ex);
     return(new AuthFailedForm());
 }
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     //return new instance of IAdapterPresentationForm derived class
     return new AdapterPresentation();
 }
Exemplo n.º 14
0
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     return(new SRSMFAAdapterPresentationForm(false, question, answer));;
 }
Exemplo n.º 15
0
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     return(new YubiKeyMFAPresentationForm());;
 }
Exemplo n.º 16
0
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     DummyLogger.Log("IAuthenticationAdapter.OnError");
     return(new DummyAdapterPresentation(request, ex));
 }
Exemplo n.º 17
0
 // Handle the errors during the authentication process during BeginAuthentication or TryEndAuthentication
 public IAdapterPresentation OnError(System.Net.HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     logger.TraceData(TraceEventType.Error, 0, ex);
     Logging.Log.AuthenticationGeneralError(ex.Message);
     return(new AdapterPresentation(AuthView.AuthError, cfgAdfs, ex.Message));
 }
Exemplo n.º 18
0
 public IAdapterPresentation OnError(HttpListenerRequest request, ExternalAuthenticationException ex)
 {
     //return new instance of IAdapterPresentationForm derived class
     return(new CustomPresentationForm(phoneMssg, ex.Message));
 }
 protected IAdapterPresentationForm CreateAdapterPresentationOnError(string username, ExternalAuthenticationException ex)
 {
     return(new UsernamePasswordPresentation(username, ex));
 }