From 7944911ec918846e532b80a4a9b78cb040e6951f Mon Sep 17 00:00:00 2001 From: groales Date: Thu, 4 Dec 2025 17:29:46 +0100 Subject: [PATCH] Actualizar Azure AD con variables correctas (AZURE_TENANT, AZURE_APP_ID, AZURE_APP_SECRET) --- Personalización.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Personalización.md b/Personalización.md index 935967a..b99ed37 100644 --- a/Personalización.md +++ b/Personalización.md @@ -69,7 +69,47 @@ SAML2_AUTOLOAD_METADATA=true --- -## OAuth (Google, GitHub, GitLab) +## OAuth (Google, GitHub, GitLab, Azure AD) + +### Azure AD (Microsoft Entra ID) + +1. Registra aplicación en [Azure Portal](https://portal.azure.com/) → **Azure Active Directory** → **App registrations** +2. **New registration**: + - **Name**: BookStack + - **Supported account types**: Single tenant + - **Redirect URI**: `https://bookstack.tudominio.com/login/service/azure/callback` +3. Anota **Application (client) ID** y **Directory (tenant) ID** +4. En **Certificates & secrets**, crea **New client secret** y anótalo +5. En **API permissions**, añade: + - **Microsoft Graph** → **Delegated permissions** → `User.Read`, `email`, `openid`, `profile` + - Click **Grant admin consent** + +**Añade al .env**: + +```env +# Azure AD OAuth +AZURE_TENANT=tu-tenant-id +AZURE_APP_ID=tu-application-client-id +AZURE_APP_SECRET=tu-client-secret +AZURE_AUTO_REGISTER=true +AZURE_AUTO_CONFIRM_EMAIL=true +``` + +**Reinicia**: +```bash +docker restart bookstack +``` + +**Opciones adicionales**: + +```env +# Sincronizar grupos de Azure AD (opcional) +AZURE_USER_TO_GROUPS=true +AZURE_GROUPS_CLAIM=groups +AZURE_REMOVE_FROM_GROUPS=true +``` + +> ℹ️ **Nota**: Para sincronización de grupos, añade en Azure AD **Token configuration** el claim `groups`. ### Google OAuth