示例#1
0
        public IHttpActionResult Logout()
        {
            logger.Start("[AuthenticationController.Logout] called");

            var ctx = Request.GetOwinContext();

            ctx.Authentication.SignOut(
                Constants.PrimaryAuthenticationType,
                Constants.ExternalAuthenticationType,
                Constants.PartialSignInAuthenticationType);

            ClearLoginRequestMessage();

            return(new EmbeddedHtmlResult(Request,
                                          new LayoutModel
            {
                Server = settings.GetSiteName(),
                Page = "logout"
            }));
        }
示例#2
0
        public IHttpActionResult Logout()
        {
            logger.Start("[LogoutController.Logout] called");

            return(new EmbeddedHtmlResult(
                       Request,
                       new LayoutModel
            {
                Server = settings.GetSiteName(),
                Page = "logoutprompt",
                PageModel = new
                {
                    url = Url.Route(Constants.RouteNames.Logout, null)
                }
            }));
        }
示例#3
0
        private IHttpActionResult CreateConsentResult(
            ValidatedAuthorizeRequest validatedRequest,
            NameValueCollection requestParameters,
            string errorMessage)
        {
            var    consentModel = new ConsentModel(validatedRequest, requestParameters);
            string name         = User.GetName();

            return(new EmbeddedHtmlResult(
                       Request,
                       new LayoutModel
            {
                Server = _settings.GetSiteName(),
                ErrorMessage = errorMessage,
                Page = "consent",
                Username = name,
                SwitchUrl = Url.Route("switch", null) + "?" + requestParameters.ToQueryString(),
                PageModel = consentModel
            }));
        }