learn hapi — API Login With Username and Password to Generate a JWT

Building an API usually involves user accounts and personal data. Users should see their personalized dashboard or newsfeed. This requires API endpoints that identify the requesting user. The most straightforward approach: API endpoints that require authentication.

The login with username and password is the first part of API authentication. The username can also be a user’s email address. We’ll use the “username” in this tutorial to represent the email as well.

With the username and password login, you’ll create a user-specific JSON web token (JWT). You’ll use this JWT in the second tutorial on API authentication where you’ll proceed with the authentication handling and switching endpoints from public to private.

hapi Series Overview

Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.

Enroll to receive exclusive content or sign in if you’re already a Future Student.

Enroll me for $15/mo

Explore the Library

Find interesting tutorials and solutions for your problems.