Skip to content

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

License

Notifications You must be signed in to change notification settings

visualjeff/msal-login-webcomponent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published