locked
Windows Azure Authentication not working after publish my asp.net web RRS feed

  • Question

  • I have an asp.net website using Windows Azure Active Directory Authentication,

    The code works fine on local machine, it pops up a window to ask me to sign in, but after publishing to windows azure, the pop up disappears, and directly access my website page.

    Exception:Error HRESULT E_FAIL has been returned from a call to a COM component. Error code:-2147467259


    I'm look at this, any suggestion will be appreciated.

    Code

      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;
             
            }

    • Moved by CoolDadTx Wednesday, November 15, 2017 2:49 PM ASP.NET related
    Wednesday, November 15, 2017 11:56 AM

All replies

  • Please post questions related to ASP.NET in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Wednesday, November 15, 2017 2:49 PM