public void GetLogin_WithSignInMessage_ReturnsLoginPage()
 {
     var msg = new SignInMessage();
     var val = msg.Protect(60000, protector);
     var resp = Get(Constants.RoutePaths.Login + "?message=" + val);
     AssertPage(resp, "login");
 }
        private string Protect(SignInMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            return(message.Protect(options.DataProtector));
        }
 private HttpResponseMessage GetLoginPage(SignInMessage msg = null)
 {
     msg = msg ?? new SignInMessage() { ReturnUrl = Url("authorize") };
     
     var val = msg.Protect(60000, protector);
     var resp = Get(Constants.RoutePaths.Login + "?message=" + val);
     resp.AssertCookie(AuthenticationController.SignInMessageCookieName);
     client.SetCookies(resp.GetCookies());
     return resp;
 }
        private HttpResponseMessage Execute()
        {
            var response = new HttpResponseMessage(HttpStatusCode.Redirect);

            try
            {
                var sim = _message.Protect(600, _protector);
                var url = _env.GetIdentityServerBaseUrl() + Constants.RoutePaths.Login;
                url += "?message=" + sim;

                var uri = new Uri(url);
                response.Headers.Location = uri;
            }
            catch
            {
                response.Dispose();
                throw;
            }

            Logger.Info("Redirecting to login page");
            return(response);
        }
        private HttpResponseMessage Execute()
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Redirect);

            try
            {
                var sim = _message.Protect(60, _internalConfig.DataProtector);

                var urlHelper = _request.GetUrlHelper();
                var loginUrl  = urlHelper.Route(Constants.RouteNames.Login, new { message = sim });
                var uri       = new Uri(_request.RequestUri, loginUrl);

                response.Headers.Location = uri;
            }
            catch
            {
                response.Dispose();
                throw;
            }

            return(response);
        }
Beispiel #6
0
        private HttpResponseMessage Execute()
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.Redirect);

            try
            {
                var sim = _message.Protect(600, _internalConfig.DataProtector);

                var urlHelper = _request.GetUrlHelper();
                var loginUrl  = urlHelper.Route(Constants.RouteNames.Login, new { message = sim });
                var uri       = new Uri(_request.RequestUri, loginUrl);

                response.Headers.Location = uri;
            }
            catch
            {
                response.Dispose();
                throw;
            }

            Logger.Info("Redirecting to login page");
            Logger.Debug(JsonConvert.SerializeObject(_message, Formatting.Indented));
            return(response);
        }