0

I just tried to build a asp.net web form application with open ID authentication through Azure AD.

I followed the steps http://www.cloudidentity.com/blog/2014/07/24/protecting-an-asp-net-webforms-app-with-openid-connect-and-azure-ad/.

I now get the error at the line:

protected void Page_Load()
        {
            var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();

            HasPhoneNumber = string.IsNullOrEmpty(manager.GetPhoneNumber(User.Identity.GetUserId()));

In the HasPhoneNumber line I just get an exception:

An exception of type 'System.ArgumentNullException' occurred in Microsoft.AspNet.Identity.Core.dll but was not handled in user code

Additional information: Value cannot be null.

Why do I get the error?

Also, if I could get an overview/resource of what a web form is and how it works, that would be great. Thanks.

Sie Tw
  • 133
  • 1
  • 12
  • @J.Steen thanks, but I understand it is null. I am not sure why it is coming null. The identity.GetUser field is filled. – Sie Tw Jul 29 '16 at 10:39
  • The accepted answer to the duplicate contains many useful tips on finding out HOW to troubleshoot your issue. – J. Steen Jul 29 '16 at 10:45

0 Answers0