Authentik 提供程序
资源
设置
回调 URL
https://example.com/api/auth/callback/authentik
环境变量
AUTH_AUTHENTIK_ID
AUTH_AUTHENTIK_SECRET
AUTH_AUTHENTIK_ISSUER
配置
/auth.ts
import NextAuth from "next-auth";
import Authentik from "next-auth/providers/authentik";
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [Authentik({
clientId: AUTH_AUTHENTIK_CLIENT_ID
clientSecret: AUTH_AUTHENTIK_CLIENT_SECRET
issuer: AUTH_AUTHENTIK_ISSUER
})]
});
💡
issuer 应包含没有尾部斜杠的 slug - 例如 https://my-authentik-domain.com/application/o/My_Slug