GithubHelp home page GithubHelp logo

ksh5a / im.identity.admin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from weedkiller/im.identity.admin

0.0 0.0 0.0 998 KB

ASP.NET MVC Identity Administration

License: Microsoft Public License

JavaScript 11.34% ASP 0.03% C# 44.05% CSS 44.58%

im.identity.admin's Introduction

im.identity.admin

Identity Administrator is an user management application based on Microsoft Identity 2.0 framework. It provides easy administration to speed up ASP.NET projects that needs a way to manage users and user roles.

It can be used toghether with an already existing project (and its own database) in case you have to just run the script that will add the necessary tables, or can be the starting point of a new one.

Features

  • One time super administrator installation
  • Users and roles management
  • Email confirmation

Installation

  • If you have full control on your SQL Server and you want to start from scratch.

Run [IM.Identity.DB.publish.sql] (https://github.com/RazvanPredescu/im.identity.admin/blob/master/IM.Identity.DB/Publish/IM.Identity.DB.publish.sql) script to create the default database. You have to adjust the lines that specify database location:

:setvar DefaultDataPath "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER12\MSSQL\DATA\"
:setvar DefaultLogPath "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER12\MSSQL\DATA\"

In both above scenarios, you have to create your own database user (principal) that will have access to the database. This user and his corresponding password will be used in connection string in Web.config that application will use to access the database.

  • Publish website to IIS.

  • Configure website as it is suggested in the configuration section below. WARNING: You should setup your email server credentials before moving to the last step because no user account will be valid without email confirmation (not even the super administrator one). In case the email isn't received, installation procedure can be run again after the email (configuration) problem was solved.

  • Access http://www.yourwebsitehere.com/install one time install page to create Super Administrator account.

Configuration

For a functional administration site, few things have to be configured.

AppSettings.config

  1. Provide a valid SMTP or Microsoft SendGrid credentials
  2. Provide a valid SMS service credentials (optional)
  <!-- ============================================= -->
  <!-- Mail -->
  <!-- ============================================= -->

  <!-- SendGrid-->
  <add key="SendGridAccount" value="account" />
  <add key="SendGridPassword" value="password" />

  <!-- SMTP-->
  <add key="SmtpServer" value="smtp.gmail.com" />
  <add key="SmtpUserName" value="username" />
  <add key="SmtpPassword" value="password" />
  <add key="SmtpPort" value="587" />
  <add key="SmtpHtmlBody" value="True" />

  <!-- ============================================= -->
  <!-- Sms -->
  <!-- ============================================= -->

  <!-- Twilio-->
  <add key="TwilioSid" value="sid" />
  <add key="TwilioToken" value="token" />
  <add key="TwilioFromPhone" value="+206-555-1234" />

Web.config

In Web.config several settings must be specified:

Connection string:

  <connectionStrings>
    <add name="DefaultConnection" connectionString="Data Source=.;Database=IM.Identity.Test.DB; User ID=youdatabaseuser; Password=yourdatabasepassword;Pooling=True" providerName="System.Data.SqlClient" />
  </connectionStrings>

Application settings:

<appSettings file="AppSettings.config">
	<!-- Website where users will be redirected after they set-up their password (login page) -->
	<add key="UserWebsiteUrl" value="http://www.yourwebsitehere.com/" />
	
	<!-- Email that will appear to users as sender of confirmation emails -->
	<add key="MailAdmin" value="[email protected]" />
	
	<!-- Current email service (Smtp by default). Supported services are: Smtp, SendGrid -->
	<add key="EmailService" value="Smtp" />
	
	<!-- Current Sms service. Supported sms services are: Twilio -->
	<add key="SmsService" value="Twilio" />
	
	<!--Number of access attempts allowed before a user is locked out (if lockout is enabled) -->
	<add key="LockoutMaxFailedAttempts" value="5" />
	
	<!-- Default amount of time (in minutes) that a user is locked out for after MaxFailedAccessAttemptsBeforeLockout is reached -->
	<add key="DefaultAccountLockoutTimeSpan" value="5" />
</appSettings>

Note: Sms Service is not required as long as two factor authentication is not enabled.

License

MS-PL License

Reference

Some of the implementation source code was inspired from the articles originally written by Rick Anderson

im.identity.admin's People

Contributors

rzvdaniel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.