You are close, but a little in code. The unique identifier is not response.ClaimedIdentifier.OriginalString , but simply response.ClaimedIdentifier . The OriginalString is a little different, and in fact it should probably be marked internal to avoid confusion. Although ClaimedIdentifier is of type Identifier , it actually becomes a string automatically when you assign it to a string variable, so don't worry about it.
Now about splitting user accounts. Most likely, your problem is that OpenID causes a “directional authentication” in which the OpenID provider (in this case Google) sends another OpenID for the same user, depending on what value the IAuthenticationRequest.Realm property IAuthenticationRequest.Realm . It is very important that your site makes sure that Realm always has the same meaning, each time recognizing your site as the same each time, giving you the same ClaimedIdentifier for the same user every time.
So what could be wrong? Unless you set the Realm value explicitly, DotNetOpenAuth guesses that this is the URL of your home page. But it depends on the URL of the incoming request. For example, if users can visit your site using both http://www.yoursite.com/ and https://www.yoursite.com/ (note the https scheme on the second), then both are legitimate home pages , and DotNetOpenAuth will use some kind of scheme in which the user visits your login page. Similarly, if your site is available both at http://yoursite.com and http://www.yoursite.com (pay attention to www), this also becomes two different values ​​in the field. What you need to do is set the scope explicitly, with something like:
relyingParty.CreateRequest(TextBoxOpenID.Text, "https://www.yoursite.com/").RedirectToProvider();
This ensures that your users receive the same ClaimedIdentifier each time.
source share