Add Azure auth
This commit is contained in:
parent
c402000f12
commit
0b7417a788
2 changed files with 29 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import {
|
|||
import Google from "next-auth/providers/google";
|
||||
import Credentials from "next-auth/providers/credentials";
|
||||
import Apple from "next-auth/providers/apple";
|
||||
import AzureADProvider from "next-auth/providers/azure-ad";
|
||||
|
||||
const headers = { Authorization: `Token ${process.env.ZAMMAD_API_TOKEN}` };
|
||||
|
||||
|
|
@ -82,6 +83,18 @@ if (process.env.GOOGLE_CLIENT_ID && process.env.GOOGLE_CLIENT_SECRET) {
|
|||
clientSecret: process.env.APPLE_CLIENT_SECRET,
|
||||
}),
|
||||
);
|
||||
} else if (
|
||||
process.env.AZURE_AD_CLIENT_ID &&
|
||||
process.env.AZURE_AD_CLIENT_SECRET &&
|
||||
process.env.AZURE_AD_TENANT_ID
|
||||
) {
|
||||
providers.push(
|
||||
AzureADProvider({
|
||||
clientId: process.env.AZURE_AD_CLIENT_ID,
|
||||
clientSecret: process.env.AZURE_AD_CLIENT_SECRET,
|
||||
tenantId: process.env.AZURE_AD_TENANT_ID,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
providers.push(
|
||||
Credentials({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue