Beispiel #1
0
        public async Task <ActionResult> Index()
        {
            var authenticated = await _oAuthService.CheckAuthenticationAsync();

            if (!authenticated)
            {
                return(Redirect(_oAuthService.GetAuthCodePath(new State(
                                                                  WebConfigurationManager.AppSettings[OAuth.WEBAPI_HOME_URI]
                                                                  ))));
            }
            //response.Content = new ObjectContent<AuthClientRespond>(
            //    new AuthClientRespond()
            //    {
            //        redirect = !authenticated,
            //        redirectUrl = _oAuthService.GetAuthCodePath(new State(
            //            WebConfigurationManager.AppSettings[OAuth.HOME_URI]
            //        ))
            //    }, new JsonMediaTypeFormatter(), "application/json"
            //);
            else
            {
                return(View());
            }
        }