Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DotNetOpenAuth: Webforms, Getting Started

I am trying to figure out how to get DotNetOpenAuth(http://www.dotnetopenauth.net/) working in my webforms app

I don't understand where to begin. I have an OpenIDSelector on my Login.aspx that lets you choose google or Yahoo. You can choose one, then a popup comes up, and lets you login. Once you login the program hangs because it is trying to do something with a database???

Can't I just use some control(like the OpenIDSelector) and get back that the user was authenticated, get their ClaimedID and handle the rest myself?

EDIT: Trying to get started with OpenID in Webforms? Go Here...

https://github.com/DotNetOpenAuth/DotNetOpenAuth/wiki/Creating-an-openid-relying-party-%28programatically%29

like image 570
Jason Avatar asked Mar 01 '10 05:03

Jason


People also ask

Is ASP Net web forms still supported?

ASP.NET Web Forms is no longer an option for new development. It's shunned but not dead — supported as a legacy product, but finally exiled from the future of . NET.

How do I create a Web form in Visual Studio?

Start Visual Studio, on the File menu select New, and then select Project. In the New Project dialog box, select Visual Basic or Visual C# as the programming language. In the Templates pane, select ASP.NET Empty Web Application, and name the project SofiaCarRentalWebApp. Click OK to create the solution and the project.

How does ASP Net web forms work?

In an ASP.NET Web Forms application, you use data-bound controls to automate the presentation or input of data in web page UI elements such as tables and text boxes and drop-down lists. Membership- ASP.NET Identity stores your users' credentials in a database created by the application.

What is the difference between Web Forms and MVC?

MVC focuses on separation of concern, i.e., there is no fixed code behind page for every view. A view can be called from multiple action. Web form based on functions and page behind code, i.e., there is code behind page for each view. You have to write code in that class related to this view only.


2 Answers

You don't need to use the project template. You can drop the OpenIDSelector control into any web app and it will Just Work in the minimalist "give me the username" way out of the box. There's no SQL dependencies whatsoever in the DotNetOpenAuth library. Just handle the OpenIdSelector.LoggedIn event and you'll get the username you want.

The project template, bloated as it may seem to you, assumes you actually have user data to store, and that you want to provide a reasonable log in and account management experience. It also works in web farms and cloud hosted environments. If you're starting from scratch this is a great way to get started, although naturally some code that it comes with will apply less than others, which is why you have the source -- so you can change it.

Yes, the project template includes a dependency on a database. It uses Linq-to-Entities so any database with an Entities provider works -- not just SQL Server. And it comes with the schema for that database built in. Just run setup.aspx and it should create the database for you in your local SQLExpress install.

like image 156
Andrew Arnott Avatar answered Oct 14 '22 16:10

Andrew Arnott


here's a step by step linked to from their website. http://www.plaxo.com/api/openid_recipe

like image 43
localman Avatar answered Oct 14 '22 17:10

localman