ASP. Mvc5+oracle Identity Authentication

Source: Internet
Author: User

Rookie come, just contact MVC, see MVC5 on the default with identity authentication, the company's Oracle database, think of things can support Oracle database, toss a half day to get the following things, some things may not be too accurate, look at the Great God treatise,

Tools

1 vs2013

2 Oracle 10.2

3 OADC 12c (http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html)

I. Obtaining AspNet.Identity.OracleProvider

This thing is not an extension. Microsoft.AspNet.Identity used to support orcle authentication package, NuGet direct search can be obtained, it is recommended to go directly to GitHub download source code for easy learning and development

Download down after the proposed clean-up, remove unnecessary things, convenient for later use, the project inside the things relatively simple to see it.

Two database creation

1 Try it, so I built a user randomly.

2 Import the Build table statement, AspNet.Identity.OracleProvider project below Oracleidentity.sql, put under plsql under execution, create 5 tables

Three. Add to Project

1 new MVC5 Project (Personal identity authentication)

2 Add the AspNet.Identity.OracleProvider project to the new solution (I did it, I might expand it in the future, such as adding user-related information to the Identityuser user class, and God has a better way to modify the project.) , ask me)

Four Project modifications

Database aspects

1 Connection string modification <add name= "defaultconnection" connectionstring= "Data SOURCE=ORCL; User ID = cc; Password = cc "providername=" Oracle.manageddataaccess.client;provider "/>

2 Add Reference Oracle.manageddataaccess

Identity aspects

1 Go to AccountController, you can see that the AccountController default constructor calls the using Microsoft.AspNet.Identity.EntityFramework, which we don't use, Let's delete this reference, add the using AspNet.Identity.OracleProvider, this reference, and modify the code as follows

Public AccountController ()
: This (new usermanager<identityuser> new Userstore (New Oracledatacontext ())))
{
}

2 All ApplicationUser in the replacement class are Identityuser

3 run under test, registration, login has been used

ASP. Mvc5+oracle Identity Authentication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.