ASP.NET Identity for Web Forms

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
dunderfutz
Posts: 4
Joined: Wed 16 Apr 2014 21:12

ASP.NET Identity for Web Forms

Post by dunderfutz » Thu 17 Apr 2014 12:31

Is there an example of how to implement the ASP.NET Identity support for a Web Form application? I have followed the online example for ADO.NET implementation and MVC and it works like a charm with Oracle 12c, but no information on how to implement with a Web Forms application. There is no Account controller in the Web Forms app, and the code in the IdentityModels.cs class is substantially different.

I realize most folks are using MVC instead of Web Forms for new applications, but we may be forced to use Web Forms in our case.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: ASP.NET Identity for Web Forms

Post by Shalex » Thu 01 May 2014 16:56

Sorry for the delay. We will notify you when the corresponding walkthrough for Web Form applications is implemented.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: ASP.NET Identity for Web Forms

Post by Shalex » Tue 25 Nov 2014 11:00

Please follow the tutorial http://www.asp.net/identity/overview/ge ... ms-project with the following corrections to adjust it for using dotConnect for Oracle:

1. Skip the "Adding Identity Packages to your App" section. Instead of this, do the following:

a) install Microsoft.AspNet.Identity.Core via Manage NuGet Packages (like it was described for “Identity.E” in the original section)

b) add references to the necessary dotConnect for Oracle assemblies (by default, %installFolder% is C:\Program Files (x86)\Devart\dotConnect\Oracle\):
  • %installFolder%\Devart.Data.dll
  • %installFolder%\Devart.Data.Oracle.dll
  • %installFolder%\Web\ASP.NET Identity 2\Devart.Data.Oracle.Web.Identity.dll
c) execute the %installFolder%\Web\ASP.NET Identity 2\Install_identity_tables.sql script from the provider installation folder in your Oracle schema

2. Just after the "4" step in the "Adding Web Forms to Register Users" section replace in Register.aspx.cs:

a)

Code: Select all

using Microsoft.AspNet.Identity.EntityFramework;
with

Code: Select all

using Devart.Common.Web.Identity;
using Devart.Data.Oracle.Web.Identity;
using ApplicationUser = Devart.Common.Web.Identity.IdentityUser;
b)

Code: Select all

var userStore = new UserStore<IdentityUser>();
var manager = new UserManager<IdentityUser>(userStore);
var user = new IdentityUser() { UserName = UserName.Text };
with

Code: Select all

var userStore = new OracleUserStore();
var manager = new UserManager<ApplicationUser>(userStore);
var user = new IdentityUser() { UserName = UserName.Text };
3. On the "6" step in the "Adding Web Forms to Register Users" section specify your Oracle connection string, for example:

Code: Select all

<configuration>
   <connectionStrings>
      <add name="DefaultConnection" connectionString="User Id=my_user;Password=my_password;server=dboracle;direct=true;sid=orcl1120;" providerName="Devart.Data.Oracle" />
   </connectionStrings>
</configuration>

Post Reply