A minimal membership provider requires a dedicated table to keep track of user names and passwords.
This is a sample “Users” table with “identity” primary key. It is necessary to create a sequence and trigger to update the identity key every time a new user is created.
SQL:create sequence users_seq;
Here is how the table may look if a “unique identifier” primary key is implemented. Oracle will automatically assign a unique identifier when a new user is created.
SQL:create table users
User roles are hardcoded in the minimal Role Provider implementation.
Create a table in your database using one of the scripts specified above.
Select the project name on the start page of the application generator and choose Settings.
Proceed to Authentication and Membership.
Select “Enable custom membership and role providers” option and enter the following configuration settings.
column [int|uiid] UserID = user_id
column [text] UserName = user_name
column [text] Password = password
role Administrators = admin
role Users = admin, user
role Everybody = *
The configuration maps logical table Users required for membership provider implementation to the physical database table Users. It also defines three user roles – Administrators, Users, and Everybody.
Generate the project to see the membership provider in action.