Giter Club home page Giter Club logo

active-directory-node-webapp-openidconnect's Introduction

services platforms author
active-directory
nodejs
brandwe

Integrating Azure AD into a NodeJS web application

This Node.js app will give you with a quick and easy way to set up a Web application in node.js with Express using OpenID Connect. The sample server included in the download is designed to run on any platform.

We've released all of the source code for this example in GitHub under an MIT license, so feel free to clone (or even better, fork!) and provide feedback on the forums.

Quick Start

Getting started with the sample is easy. It is configured to run out of the box with minimal setup.

Step 1: Register an Azure AD Tenant

To use this sample you will need a Azure Active Directory Tenant. If you're not sure what a tenant is or how you would get one, read What is an Azure AD tenant? or Sign up for Azure as an organization. These docs should get you started on your way to using Azure AD.

Step 2: Download node.js for your platform

To successfully use this sample, you need a working installation of Node.js.

Step 3: Download the Sample application and modules

Next, clone the sample repo and install the project's NPM dependencies.

From your shell or command line:

  • $ git clone [email protected]:Azure-Samples/active-directory-node-webapp-openidconnect.git
  • $ cd active-directory-node-webapp-openidconnect
  • $ npm install

Step 5: Configure your server using config.js

Provided for simplicity, config.js contains some simple variables. In a real application, it would be best to use environment variables, a Node.js configuration system, or Azure Key Vault to store credentials securely, outside of your source control system.

In config.js, your tenant ID should go in the realm configuration field.

NOTE: You may also pass the issuer: value if you wish to validate that as well.

Step 6: Run the application

  • $ node app.js

Is the server output hard to understand?: We use bunyan for logging in this sample. The console won't make much sense to you unless you also install bunyan and run the server like above but pipe it through the bunyan binary:

  • $ npm install -g bunyan
  • $ node app.js | bunyan

You're done!

You will have a server successfully running on http://localhost:3000.

Acknowledgements

We would like to acknowledge the folks who own/contribute to the following projects for their support of Azure Active Directory and their libraries that were used to build this sample. In places where we forked these libraries to add additional functionality, we ensured that the chain of forking remains intact so you can navigate back to the original package. Working with such great partners in the open source community clearly illustrates what open collaboration can accomplish. Thank you!

About The Code

Coming soon...

active-directory-node-webapp-openidconnect's People

Contributors

acomsmpbot avatar brandwe avatar dstrockis avatar gsacavdm avatar iambmelt avatar jeffwilcox avatar

Watchers

 avatar  avatar  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.