Giter Site home page Giter Site logo

visualjeff / msal-login-webcomponent Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 13 KB

HTML5 Web Component for Implicit flow authentication. Includes a component for displaying user details.

License: MIT License

HTML 10.96% JavaScript 89.04%
msal webcomponents html5 webcomponent aadv2 azure authentication javascript

msal-login-webcomponent's Introduction

msal-login-webcomponent

HTML5 WebComponent for Implicit flow authentication. Additionally includes a component for displaying user and token information. Recently updated to work with version 1.0.0 of MSAL.

  1. Start by Registering an App (app registrations) with Azure Active Directory.
  2. For this new App, set the reply URL's to http://localhost:4200
  3. Configure the webcomponent for authentication by updating the button attributes (clientId and resource) in index.html:
<button
  id="auth-button" 
  is="auth-button" 
  clientId="<<PUT YOUR CLIENTID HERE>>" 
  resource="https://login.microsoftonline.com/<<TENANT>>.onmicrosoft.com" 
  redirectUri="<<PUT YOUR REPLY URL HERE>>"
  loggingEnabled=true>Login</button>

NOTE: The auth-button webcomponent also support domainHint and loginHint as attributes. Add in these attributes if needed.

B2C_NOTE: See https://docs.microsoft.com/en-us/azure/active-directory-b2c/b2clogin for help with the resource attribute. Don't use login.microsoftonline.com for b2c.

To test locally on Linux with an HTTP server:

python -m SimpleHTTPServer 4200

To exercise the login button, open your browser (I use Google Chrome) and go to: http://localhost:4200/

Enjoy,

Visualjeff

msal-login-webcomponent's People

Contributors

visualjeff avatar

Stargazers

 avatar

Watchers

 avatar  avatar

msal-login-webcomponent's Issues

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.