diff --git a/nuxt4/app/components/auth/UserMetadata.vue b/nuxt4/app/components/auth/UserMetadata.vue
index 2d53897..2151c63 100644
--- a/nuxt4/app/components/auth/UserMetadata.vue
+++ b/nuxt4/app/components/auth/UserMetadata.vue
@@ -59,11 +59,28 @@
{{ group }}
- Sin grupos
+ Sin grupos asignados
+
+
+
+
Información de Conexión
+
+
+
+ App:
+ {{ user.appSlug }}
+
+
+
+ Outpost:
+ {{ user.outpostName }}
+
+
+
diff --git a/nuxt4/app/composables/useAuthentik.ts b/nuxt4/app/composables/useAuthentik.ts
index 3e99bf2..3a78b1f 100644
--- a/nuxt4/app/composables/useAuthentik.ts
+++ b/nuxt4/app/composables/useAuthentik.ts
@@ -1,6 +1,16 @@
/**
* Composable para leer información de usuario de Authentik
* Los headers son inyectados por Authentik Proxy Outpost
+ *
+ * Documentación de headers disponibles:
+ * - x-authentik-username: Username del usuario
+ * - x-authentik-email: Email del usuario
+ * - x-authentik-name: Nombre completo del usuario
+ * - x-authentik-uid: UID único del usuario
+ * - x-authentik-groups: Grupos separados por |
+ * - x-authentik-meta-app: Slug de la aplicación en Authentik
+ * - x-authentik-meta-outpost: Nombre del outpost
+ * - Nota: Los roles RBAC son internos de Authentik y no se exponen via headers
*/
interface AuthentikUser {
@@ -10,6 +20,9 @@ interface AuthentikUser {
groups: string[]
uid: string | undefined
avatar: string
+ // Metadata de la aplicación y outpost
+ appSlug?: string
+ outpostName?: string
}
interface AuthStatusResponse {
@@ -32,6 +45,8 @@ export const useAuthentik = () => {
const name = headers['x-authentik-name']
const groups = headers['x-authentik-groups']
const uid = headers['x-authentik-uid']
+ const appSlug = headers['x-authentik-meta-app']
+ const outpostName = headers['x-authentik-meta-outpost']
// Si no hay username, el usuario no está autenticado
if (!username) {
@@ -42,8 +57,10 @@ export const useAuthentik = () => {
username,
email,
name,
- groups: groups ? groups.split('|') : [],
+ groups: groups ? groups.split('|').filter(g => g.trim()) : [],
uid,
+ appSlug,
+ outpostName,
// Generar avatar URL usando UI Avatars
avatar: `https://ui-avatars.com/api/?name=${encodeURIComponent(name || username)}&background=random&size=128`
}
diff --git a/nuxt4/app/server/api/debug/headers.ts b/nuxt4/app/server/api/debug/headers.ts
index f0db13a..afdd58b 100644
--- a/nuxt4/app/server/api/debug/headers.ts
+++ b/nuxt4/app/server/api/debug/headers.ts
@@ -16,6 +16,12 @@ export default defineEventHandler((event) => {
}
}
+ // Log en consola del servidor para debugging
+ console.log('=== AUTHENTIK HEADERS ===')
+ console.log(JSON.stringify(authentikHeaders, null, 2))
+ console.log('=== ALL HEADERS ===')
+ console.log(JSON.stringify(allHeaders, null, 2))
+
return {
authentikHeaders,
allHeaders