---
title: "Auth.js AUTH_SECRET Generator – pwgen.de"
description: "32 random bytes in base64, equivalent to openssl rand -base64 32."
canonical_url: "https://pwgen.de/en/auth-js-secret-generator"
meta:
  "og:description": "32 random bytes in base64, equivalent to openssl rand -base64 32."
  "og:image": "https://pwgen.de/_og/s/o_509bb174dc247fa5.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Auth.js AUTH_SECRET Generator – pwgen.de"
  "twitter:image": "https://pwgen.de/_og/s/o_509bb174dc247fa5.png"
---

> Index of every page on this site: [llms.txt](https://pwgen.de/llms.txt)

# **Auth.js AUTH\_SECRET Generator**

32 random bytes in base64, equivalent to openssl rand -base64 32.

Very strong**0 bits**Generated in your browser

## **Local alternative**

`openssl rand -base64 32`

Prefer generating secrets on the machine that uses them? This command produces an equivalent value.

[Official documentation](https://authjs.dev/getting-started/deployment)

Auth.js, formerly NextAuth.js, signs and encrypts session tokens and JWTs with this value. It is mandatory in production and the application refuses to start without it. Changing the value signs out every logged-in user.

## **Frequently asked questions**

Into the AUTH\_SECRET environment variable. Auth.js uses it to encrypt the session cookie and sign internal tokens. In production the value is mandatory — without it, Auth.js refuses to start.

Every existing session becomes invalid and all signed-in users have to authenticate again. For a planned rotation, pick a low-traffic window.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pwgen.de/en#website","@type":"WebSite","description":"Kostenloser, datenschutzfreundlicher Passwort-Generator. Generierung direkt im Browser – keine Passwörter werden gespeichert.","inLanguage":"en-US","name":"pwgen.de","url":"https://pwgen.de/en","publisher":{"@id":"https://pwgen.de/#identity"},"translationOfWork":{"@id":"https://pwgen.de/#website"}},{"@id":"https://pwgen.de/en/auth-js-secret-generator#webpage","description":"32 random bytes in base64, equivalent to openssl rand -base64 32.","name":"Auth.js AUTH_SECRET Generator","url":"https://pwgen.de/en/auth-js-secret-generator","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://pwgen.de/en/auth-js-secret-generator#breadcrumb"},"isPartOf":{"@id":"https://pwgen.de/en#website"},"mainEntity":[{"@id":"https://pwgen.de/en/auth-js-secret-generator#/schema/question/1"},{"@id":"https://pwgen.de/en/auth-js-secret-generator#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://pwgen.de/en/auth-js-secret-generator"]}],"primaryImageOfPage":{"@id":"https://pwgen.de/#logo"}},{"@id":"https://pwgen.de/#identity","@type":"Organization","email":"info@htrs.io","legalName":"GbR HTRS i/o","name":"HTRS i/o","telephone":"+49 221 292 513 03","url":"https://pwgen.de","vatID":"DE359532582","address":{"@type":"PostalAddress","streetAddress":"Gotenring 9","addressLocality":"Köln","postalCode":"50679","addressCountry":"DE"},"logo":{"@id":"https://pwgen.de/#logo"},"sameAs":["https://htrs.io"]},{"@id":"https://pwgen.de/en/auth-js-secret-generator#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","name":"pwgen.de – Auth.js AUTH_SECRET Generator","operatingSystem":"Web Browser","offers":{"@type":"Offer","availability":"https://schema.org/InStock","price":"0","priceCurrency":"EUR","priceValidUntil":"2027-12-30T00:00:00.000Z"}},{"@id":"https://pwgen.de/en/auth-js-secret-generator#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"pwgen.de","item":"https://pwgen.de/en","position":1},{"@type":"ListItem","name":"Secrets","item":"https://pwgen.de/en/secrets","position":2},{"@type":"ListItem","name":"Auth.js AUTH_SECRET Generator","position":3}]},{"@id":"https://pwgen.de/en/auth-js-secret-generator#/schema/question/1","@type":"Question","inLanguage":"en","name":"Where does AUTH_SECRET go?","acceptedAnswer":{"@type":"Answer","text":"Into the AUTH_SECRET environment variable. Auth.js uses it to encrypt the session cookie and sign internal tokens. In production the value is mandatory — without it, Auth.js refuses to start."}},{"@id":"https://pwgen.de/en/auth-js-secret-generator#/schema/question/2","@type":"Question","inLanguage":"en","name":"What happens on rotation?","acceptedAnswer":{"@type":"Answer","text":"Every existing session becomes invalid and all signed-in users have to authenticate again. For a planned rotation, pick a low-traffic window."}},{"@id":"https://pwgen.de/#logo","@type":"ImageObject","caption":"HTRS i/o","contentUrl":"https://pwgen.de/apple-touch-icon.png","inLanguage":"en","url":"https://pwgen.de/apple-touch-icon.png"}]}
```

## Sitemap

See the full [sitemap](https://pwgen.de/sitemap.md) for all pages.
