Try Logging In

Test the login endpoint and receive a JWT token

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

Test the login endpoint

The login endpoint returns two fields: access_token and token_type. The access_token is a long encoded string — your JWT. The token_type is always "bearer", which tells the client how to send the token in future requests.

The token looks like random text, but it is actually three base64-encoded sections separated by dots. You can paste it at jwt.io to see the payload — the email address and expiration time are inside.

Instructions

Log in with the user you registered.

  1. Run the curl command to log in with email alice@example.com and password secret123.