Giter Site home page Giter Site logo

debashisbarman / active-directory-b2c-javascript-nodejs-webapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/active-directory-b2c-javascript-nodejs-webapi

0.0 2.0 0.0 10 KB

A small Node.js Web API for Azure AD B2C that shows how to protect your web api and accept B2C access tokens using Passport.js.

Home Page: http://aka.ms/aadb2c

License: MIT License

JavaScript 100.00%

active-directory-b2c-javascript-nodejs-webapi's Introduction

services platforms author
active-directory-b2c
node.js
navyasric

Node.js Web API with Azure AD B2C

This sample demonstrates how to protect a Node.js web API with Azure AD B2C using the Passport.js library. The code here is pre-configured with a registered client ID. If you register your own app, you will need to replace the client ID.

We have deployed this API to Azure to allow testing without running it locally. Checkout one of the apps in Next Steps to use it!

Steps to Run

  1. Clone the code.

    git clone https://github.com/Azure-Samples/active-directory-b2c-javascript-nodejs-webapi

  2. Make sure you've installed Node.

  3. Install the node dependencies:

    npm install && npm update
    
  4. Run the Web API! By default it will run on http://localhost:5000.

    node index.js
    

Next Steps

The /hello endpoint in this sample is protected so an authorized request to it requires an access token in the header. You can make authorized requests to this web API using an iOS App or Android App. Make sure to update the app configs if you want it to point to your local hello api.

Alternatively, you can register your own app and point to this web API.

Customize your user experience further by supporting more identity providers. Checkout the docs belows to learn how to add additional providers:

Microsoft

Facebook

Google

Amazon

LinkedIn

Questions & Issues

Please file any questions or problems with the sample as a GitHub issue. You can also post on Stackoverflow with the tag azure-ad-b2c. For OAuth2.0 library issues, please see note below.

active-directory-b2c-javascript-nodejs-webapi's People

Contributors

danieldobalian avatar gsacavdm avatar microsoftopensource avatar msftgits avatar navyasric avatar

Watchers

 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.