Skip to content

nicosabena/lock

 
 

Repository files navigation

Auth0

Lock

NPM version Build status Test coverage Dependency Status License Downloads

Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps, Salesforce.

Lock makes it easy to integrate SSO in your app. You won't have to worry about:

  • Having a professional looking login dialog that displays well on any resolution and device.
  • Finding the right icons for popular social providers.
  • Remembering what was the identity provider the user chose the last time.
  • Solving the home realm discovery challenge with enterprise users (i.e.: asking the enterprise user the email, and redirecting to the right enterprise identity provider).
  • Implementing a standard sign in protocol (OpenID Connect / OAuth2 Login)

Auth0

You can try it out yourself online at our Auth0 Lock playground.

Install

From npm:

npm install auth0-lock

From bower:

bower install auth0-lock

Or our CDN:

<!-- Latest minor release -->
<script src="https://cdn.auth0.com/js/lock-9.x.min.js"></script>

<!-- Latest patch release (recommended for production) -->
<script src="https://cdn.auth0.com/js/lock-9.x.y.min.js"></script>

If you are targeting mobile audiences, it's recommended that you add:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>

Browserify

No special configuration is required if you are using Browserify to build your project.

Webpack

If you are using Webpack, besides the auth0-lock and webpack modules, you will need to install the json and transform loaders ($ npm install --save json-loader transform-loader) and then use them in your webpack.config.js file:

loaders: [{
  test: /node_modules[\\\/]auth0-lock[\\\/].*\.js$/,
  loaders: [
    'transform-loader/cacheable?brfs',
    'transform-loader/cacheable?packageify'
  ]
}, {
  test: /node_modules[\\\/]auth0-lock[\\\/].*\.ejs$/,
  loader: 'transform-loader/cacheable?ejsify'
}, {
  test: /\.json$/,
  loader: 'json-loader'
}]

Documentation

You can find the full documentation for Lock on the Auth0 docs site.

Demos

The support/development-demo directory has a ready-to-go app. In order to run it you need node installed.

Then execute npm i to install dependencies (only once) and npm run demo from the root of this project.

Finally, point your browser at https://localhost:3000/ and play around.

Examples

The examples directory has some implementation samples you can find useful:

Browser Compatibility

We ensure browser compatibility in Chrome, Safari, Firefox and IE >= 9. We currently use zuul along with Saucelabs to run integration tests on each push.

Contributing

To run the tests:

Run grunt dev and point your browser to https://localhost:9999/test_harness.html to run the test suite.

Run grunt phantom if you have PhantomJS installed.

Run grunt integration (or npm test) if you have SauceLabs account. You will need a SAUCE_ACCESS_KEY and SAUCE_USERNAME env variables.

To publish a new version use:

  # release new version
  $ ./bin/version {patch,minor,major}

  # update remote repository
  $ git push origin master

  # and let Auth0's CI worry about the rest

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Packages

No packages published

Languages

  • CSS 52.3%
  • JavaScript 38.3%
  • HTML 9.2%
  • Shell 0.2%