Azure Web服务不工作办公室365登录屏幕不显示

时间:2017-11-09 08:19:54

标签: c# asp.net-mvc azure

步骤1#登录页面加载之后我按下登录控制器名称中的方法的按钮是loginProcess

步骤2#登录时,进程点击它调用方法SignIn

步骤3#SignIn方法调用Azure身份验证

当我在azure上发布我的网页时遇到问题我的登录方法不起作用 当我在azure office 365上发布我的网页时,没有加载登录弹出窗口。在本地主机上,当我调用我的signin方法时它被加载了。在Azure上发布Web后,这种行为的原因是什么。

  [HttpGet]
            public  ActionResult Login()
            {
                var DashboardDate = DateTime.Now.ToShortDateString();
                ViewBag.Date = DashboardDate;         
                return View();
            } 

  [HttpGet]
        public async Task <ActionResult>LoginProcess()
        {
            try
            {
              if (await new ServiceAPIConnection().SignIn())
                {




  }
            catch (Exception ex)
            {
                //new ExceptionHandling().InsertErrorLog(ex);
                GlobalMembers.DynamicDialog("Your credentials did not work or the service is down. Please try again." + "|Login: 03"); 

this is Sign in method 

public async Task<bool> SignIn()
        {
            try
            {
                SignOut();
                 AuthenticationResult result = await authContext.AcquireTokenAsync(GlobalSettings.todoListResourceId, GlobalSettings.clientId, redirectURI, new PlatformParameters(PromptBehavior.Always));        
                if (string.IsNullOrWhiteSpace(result.AccessToken))
                {
                    return false;
                }

                userName = result.UserInfo.DisplayableId.ToString().Trim();
                userToken = result.AccessToken.Trim();

            }
            catch (Exception ex)
            {
                return false;
            }


            return true;

0 个答案:

没有答案