GithubHelp home page GithubHelp logo

alexmaroz / ravendb.modernmvcstarterkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from judahgabriel/ravendb.modernmvcstarterkit

0.0 1.0 0.0 1.34 MB

An ASP.NET MVC project with RavenDB backend, using SendGrid and Twilio for user registration confirmation and optional two-factor authentication.

C# 81.32% CSS 0.37% ASP 0.07% HTML 3.67% JavaScript 14.57%

ravendb.modernmvcstarterkit's Introduction

RavenDB Modern MVC Starter Kit

An MVC sample project that uses RavenDB as the backend, supports user registration and confirmation via email (SendGrid), and optionally supports Two-Factor Authentication via email (SendGrid) or SMS (Twilio).

This project provides:

  • A RavenDB-backed identity provider, updated to work with the latest MS Identity Framework (2.1 at the time of this writing).
  • A registration confirmation system: when a user registers, he is required to confirm his registration via email. The email is sent via your developer SendGrid account. Upon registering, the user is presented with the following screen:


The user will receive an email with a confirmation link. Following the link, he'll be taken to this page:

- Optional two-factor authentication: Users can optionally go to their profile page and add a phone number and enable Two-Factor Authentication:


When the user enters his phone number, we send an SMS verification code via your developer Twilio account:


With Two-Factor Authentication enabled, when the user goes to sign-in next time, he will first login as usual, and then be prompted to enter the 2nd form of identification, either email or SMS:


The user will receive a verfication code via SMS or email and be redirected to the verification page:


Upon entering the verification code, they'll be able to sign in.

#To run this sample:

  1. Run a RavenDB server locally on the default port (8080). Alternately, change the RavenDB connection string in web.config to point it to a database somewhere else.
  2. Get a SendGrid account. Sign up here for a free 200 emails/day account.
  3. Get a Twilio account. Sign up here for a free account.
  4. Create an empty file in the RavenDB.ModernMvcStarterKit\RavenStarterKit directory, name it AppSettingsSecrets.config.ignore
  5. Put your Twilio and SendGrid credentials in AppSettingsSecrets.config.ignore, so that it looks like this:
   <appsettings>    
      <!-- SendGrid--> 
      <add key="mailAccount" value="SendGrid account ID" />
      <add key="mailPassword" value="SendGrid password" />
   
      <!-- Twilio--> 
      <add key="TwilioSid" value="Twilio SID" />
      <add key="TwilioToken" value="Twilio secret token" />
      <add key="TwilioFromPhone" value="Twilio number here, e.g. +13334444333" /> 
   </appsettings>

That's it! You now have an MVC site with RavenDB, user registrations with email confirmation, plus optional Two-Factor Authentication.

Have fun!

Questions? I'm @judahgabriel on Twitter.

ravendb.modernmvcstarterkit's People

Contributors

judahgabriel avatar

Watchers

James Cloos 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.