Sign Up

2. Creating an Authentication User

Continuing from the previous "Getting Started" tutorial, our current objective is to create an Authentication user and obtain a server-generated token for authenticating future API requests.

  1. To start, retrieve your API URL by clicking "Preview" in the top bar. This action will open the API Preview, displaying your API URL.
  2. The API URL will be available after a successful build.

  3. Next, use the API client to send API requests.
  4. The following authentication endpoints can be visible in the "API Preview" dialog.

  5. Begin by sending a POST request to the "/auth/signup" endpoint, with a JSON body containing a username, email, and password.
  6. Upon successful execution, you will receive a complete Auth User object as the response, which contains the password as an encrypted hash.
  7. Now, using the newly created Auth User, you can request an API token from your API. This token grants you access to secure endpoints, including the POST endpoint created earlier.
  8. To do so, send a POST request to "/auth/login" using "Basic Authorization", providing your username and password.
  9. As a result, the API will issue a token, which you can use to authenticate all subsequent requests. This token serves as the key to securely access and interact with your API's protected functionalities.

Next Steps: Send a request to a secure endpoint

Related Topics