Angular 1.x+ Layer API

Add the needed dependencies to your client application

Install the dependencies with Bower or npm.

Bower

bower install auth0-lock angular-lock angular-jwt
<!-- index.html -->

...

<!-- Dependencies -->
<script src="bower_components/auth0-lock/build/lock.js"></script>
<script src="bower_components/angular-lock/dist/angular-lock.js"></script>
<script src="bower_components/angular-jwt/dist/angular-jwt.js"></script>

<!-- App Scripts -->
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="home/home.js"></script>
<script type="text/javascript" src="login/login.js"></script>

...

npm

npm install angular-lock angular-jwt
<!-- index.html -->

...

<!-- Dependencies -->
<script type="text/javascript" src="https://cdn.auth0.com/js/lock/10.12.1/lock.min.js"></script>
<script src="node_modules/angular-lock/dist/angular-lock.js"></script>
<script src="node_modules/angular-jwt/dist/angular-jwt.js"></script>

<!-- App Scripts -->
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="home/home.js"></script>
<script type="text/javascript" src="login/login.js"></script>

...

Show Lock, the login box, to the user

// LoginCtrl.js
angular.module('YOUR-APP-NAME').controller( 'LoginCtrl', function ( $scope, auth) {

  $scope.auth = auth;

});
<!-- login.html -->
<!-- ... -->
<input type="submit" ng-controller="LoginCtrl" ng-click="auth.signin()" />
<!-- ... -->

Activate the Layer API addon in your Auth0 dashboard

Activate Addons in your Auth0 dashboard

Call the Delegation endpoint from Auth0 to get a token for Layer API

curl --data \
 "client_id=YOUR_CLIENT_ID&\
 &grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer\
 &refresh_token=\
 &scope=open_id\
 &api_type=layer"\
 https://YOUR_ACCOUNT.auth0.com/delegation

Use the newly got token to call the Layer API

GET STARTED IN MINUTES
Authentication Security and Availability

Authentication Built for Security & High Availability

Auth0 is the easiest way for developers to integrate enterprise-grade authentication and identity management to any app.

Industry Standard Compliance
Authentication Certifications and Compliance

SOC 2, HIPAA/BAA, EU/US Privacy Shield Framework, Open ID Certified.

Learn More
Built by Security Experts
uthentication Experts

Continuously reviewed and tested by external security experts. Strong password encryption and hashing algorithms, at rest and in transit.

Learn More
What Our Customers Say
Authentication Case Studies

Continuously reviewed and tested by external security experts. Strong password encryption and hashing algorithms, at rest and in transit.

Learn More
Availability & trust
Authentication Availability

Uptime time in 3 different regions.

Learn More
Host Anywhere
Auth0 Appliance

Deploy On-Premises or on Cloud on your data center or Auth0’s one.

Learn More
Auth0 Active Users

Get Auth0 free for 7,000 active users per month with unlimited logins

  • Single Sign On
  • Passwordless Login
  • Up to 2 Social Identity Providers
  • Multifactor Authentication
  • User Management
  • Extensibility (Run custom code on Auth)

Some of the companies that trust us every day

Atlassian - Authentication CustomerPBS - Authentication CustomerNVIDIA - Authentication CustomerMozilla - Authentication CustomerBluetooth - Authentication CustomerFinancial Times - Authentication CustomerJet - Authentication CustomerHMH - Authentication CustomerOptimizely - Authentication CustomerPolaris - Authentication CustomerHarper - Authentication CustomerNews Corp - Authentication Customer