Exception while attempting to authenticate with OpenID

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/26/2009 12:33:54 PM
Gravatar
Total Posts 5

Exception while attempting to authenticate with OpenID

One of our users is receiving the following error when attempting to log in using OpenID (myopenid.com). What could be the issue?

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
mojoPortal.Web.OpenIdLoginControl.IsValidForUserCreation(OpenIdEventArgs e) +15
mojoPortal.Web.OpenIdLoginControl.DoNewUserLogic(OpenIdEventArgs e) +57
mojoPortal.Web.OpenIdLoginControl.OpenIdLogin1_LoggedIn(Object sender, OpenIdEventArgs e) +111
DotNetOpenId.RelyingParty.OpenIdTextBox.OnLoggedIn(IAuthenticationResponse response) +69
DotNetOpenId.RelyingParty.OpenIdTextBox.OnLoad(EventArgs e) +154
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

1/26/2009 1:38:20 PM
Gravatar
Total Posts 18439

Re: Exception while attempting to authenticate with OpenID

I have seen this error from time to time but I'm not 100% sure the cause. One thing I would try is make sure the user is using lower case, someone else reported a problem something like this before and I think it was that he was using a mixed case url like Joe.Audette@myopenid.com instead of lower case (on linux urls are case sensitive) and also make sure the email address attached to the site user matches the email the user has attached to their open id account also case sensitive.

If we can pin this down for sure as the problem then I could force lower case on whatever they type, I'm just not yetsure if thats the right solution.

Hope it helps, let me know if you find any information.

Best,

Joe

1/26/2009 5:47:55 PM
Gravatar
Total Posts 5

Re: Exception while attempting to authenticate with OpenID

Joe,

I traced the error back to the following lines in mojoPortal.Web.OpenIdLoginControl.IsValidForUserCreation(OpenIdEventArgs e)

if (e.ProfileFields.Email.Length == 0) return false;

if (!Email.IsValidEmailAddressSyntax(e.ProfileFields.Email)) return false;

if (e.ProfileFields.FullName.Length == 0) return false;

 

It turns out there is something called a Default Persona on MyOpenID, which by default has FullName and Email NULL for new accounts. This is why the lines above are throwing an exception. The code should probably be:

if (String.IsNullOrEmpty(e.ProfileFields.Email)) return false; 
if (String.IsNullOrEmpty(e.ProfileFields.FullName)) return false;

 

1/27/2009 6:31:03 AM
Gravatar
Total Posts 18439

Re: Exception while attempting to authenticate with OpenID

Great work troubleshooting this!

I'm making the proposed change now. Just in time for the new release coming tomorrow.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.