Auth0 badgeAuth0 University

Docker 101

Docker 101

  1. Course Catalog
  2. Docker 101

About this webinar

Docker is a tool for running, creating, and managing application containers. In this webinar you will see what is and why you as a developer should care about it.

Getting Started with Auth0 Lock

Kassandra Perch

Kassandra is a Developer Evangelist by day, and an Engineering student, roboticist, and gamer by night. When they aren’t building (be it code, with cloth, or with wood), they’re hanging out and avoiding the heat in their Austin, TX home.

The demo is an Express application with a login and logout route, and some Javascript on the front-end. We can login using either Twitter or username/password, and logout.

Let's start with our assumptions for this exercise: you have a server with the following routes:

  • /users/authenticate, which Lock can call that will register a user as logged in
  • /users/logout, which Lock can call that will end a user's session and log them out

If you need help with these, we have quickstart guides in our docs, including the Express quickstart that I used to set this tutorial up.

We also have some elements in our Jade page layout:

  • .js-login, which corresponds to our 'Login' button
  • .js-logout, which corresponds to our 'Logout' button

Finally, we have imported the following libraries into our client-side environment:

That all being said, let's write our code to construct an instance of Lock that we can use. You'll need your ClientID and Auth0 domain, which you can find in the dashboard under 'Apps/APIs', and clicking your App's name.

var lock = new Auth0Lock('YOUR_CLIENT_ID', '');