
Build a simple Vue.js app with three routes, integrate Auth0 to handle login, logout, and protect routes using OpenID Connect and OAuth.
Review traditional authentication using login.php, sessions, and cookies, and the flaws these approaches face in a world of stateless APIs. Learn how OAuth 2 can address these challenges.
Explore OAuth 2.0 as the industry standard for authorization, detailing implicit and authorization code grants, the role of the authorization server, and tokens for single-page apps and APIs.
Learn how tokens, especially jwt, share permissions and user identity between server and api, with a three-part structure—header, payload with claims, and signature—to verify integrity and access control.
Create your auth0 account, sign in with username/password or social login, and set up a tenant and a single page application. Configure a callback URL in the dashboard.
Explore building a three-route app with a home, about, and secret area, showing login with Google sign-in and logout to protect the secret section.
Use the UCLA tool to scaffold a basic Vue app with a router. Run npm run serve and navigate between home, about, secret, and not authorized pages.
Install and wrap the Auth0 library, configure domain, client ID, redirect URI, audience, and scope, then implement a login button that redirects to the authorization server and handles the callback.
Parse the server response hash to extract the access token and id token, store them in memory, and validate expiry to route to the secret area with login state.
Implement a logout button by deleting the tokens file, exporting the logout function, wiring it to the component, and verifying isLoggedIn toggles with login and logout.
Guard your routes by using a router middleware that checks isLoggedIn and redirects unauthenticated users to not authorized, then protects the secret area with a beforeEnter hook.
Learn how to retrieve a full user profile via OpenID Connect after login, expose it with a getProfile function, and display the user’s name while protecting routes.
Conclude the course by showing how to onboard users to a VueJs application using Auth0, and invite feedback via course comments or Twitter.
In this course, the students will learn how to build a basic Vue Js application and how to add authentication to it by using the free Auth0 service. Starting with a blank application from vue-cli, three routes will be added so the users can login, logout and view their profile.