Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 660033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:06:42+00:00 2026-05-13T23:06:42+00:00

I am currently playing with DotNetOpenAuth to make an ASP.NET (C#) website use OpenID

  • 0

I am currently playing with DotNetOpenAuth to make an ASP.NET (C#) website use OpenID instead of the normal login-password routine for user and session handling.

Up till now, I have added the DotNetOpenAuth.dll into my project and tried a test login page with the following:

<rp:OpenIdLogin ID="OpenIdLogin1" runat="server" />

When I run the page, I enter a valid myopenid url and the website redirects to the myopenid page, where I enter my password, and upon success, it returns back to my default.aspx, due to the following in my web.config:

<authentication mode="Forms">
    <forms defaultUrl="/Default.aspx" loginUrl="~/Login.aspx"/>
</authentication> 

Now that the user is “logged in”, how can handle my session? At the moment, I don’t know how I can, for example, check if the session is still alive or how to terminate the session.

My basic question is, how can I manage the session once the user is authenticated with OpenID ?


[Update]

I am now using the following to check for authentication: HttpContext.Current.User, and with that I can now check if a user is authenticated with a session.

Now is there a possible way on how I can “link” user details that are stored in my database with an openid account?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:06:42+00:00Added an answer on May 13, 2026 at 11:06 pm

    OpenID logins with the OpenIdLogin control are (by default) no different than a username+password login from ASP.NET’s point of view. As you’ve discovered HttpContext.Current.User is set on each incoming HTTP request based on an HTTP cookie that ASP.NET FormsAuthentication sends to the browser in order to keep the session consistent from request to request. While you’re in a page or its code-behind, the Page.User property is an even more convenient means.

    But if you’re doing access control, rather than check whether there’s a logged in user in every page, it’s best to use the <authorization> tag in your web.config file to force the user to be logged in before accessing certain pages or directories of pages.

    As far as linking user details, the key you want to associate with your users’ details is the OpenID Claimed Identifier, which is what OpenIdLogin automatically assigns to the Username value for FormsAuthentication. So you can retrieve or store user details in your database based on the value of HttpContext.Current.User.Identity.Name, which will be the reliable and proven unique value for each user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently playing around with the Asp.Net mvc framework and loving it compared
i`m currently playing around with WPF and now i wonder what would be the
I'm currently playing around with HTML_QuickForm for generating forms in PHP. It seems kind
I'm currently playing with the Silverlight(Beta 2) Datagrid control. Before I wired up the
Hallo i am currently playing around with castle projects ActiveRecord and the remoting facility.
I am currently playing around with the HybridSessionBuilder class found on Jeffrey Palermo's blog
If I want to build a spectrum visualizer of what's currently playing on my
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Good night :) I am currently playing with the DevIL library that allows me
I'm currently playing about with some XNA stuff learning to program AI. Anyway, here's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.