--- title: "Authentication" slug: "authentication" status: "new" updated: 2026-12-01T15:01:31Z published: 2026-12-01T15:01:31Z canonical: "help.narmi.com/authentication" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.narmi.com/llms.txt > Use this file to discover all available pages before exploring further. # Authentication NAF apps that need to access the Public API must perform a code exchange in order to obtain a valid API token. The flow is largely based on OAuth 2.0, but there are some differences, outlined below. Authentication flow: 1. A user clicks a NAF app link in Narmi. 2. If applicable, Narmi requests authorization from the user. 3. Narmi redirects the browser to the NAF app, with a code included in the URL. 4. The NAF app retrieves the code and performs a server-to-server code exchange with the Narmi tokens endpoint (this should never be done inside the browser). 5. The NAF app stores the access token. It will use the access token to make authenticated requests to the public API by including it as a bearer token in the `Authorization` header. *Note: the token must always be kept on the server side.*