Commit Graph

7 Commits

Author SHA1 Message Date
74282d446f fix(auth): corregir redirect_uri y KC URL con localhost en producción
- workspace-auth.ts: reemplaza isInternalOnlyHost por isDevOnlyUrl que
  incluye localhost/127.0.0.1 e IPs LAN además de hostnames Docker.
  getWorkspaceBaseUrl() y getPublicKeycloakBaseUrl() ya ignoran valores
  dev-only; no usan VITE_KEYCLOAK_URL=http://localhost:... en prod.

- Nuevo resolveSystemBaseUrl(): cuando url.origin es localhost porque
  ORIGIN env var apunta a localhost en producción, busca SITE_URL/APP_URL
  como fallback para construir redirect_uri seguros.

- buildKeycloakAuthorizationUrl() y buildKeycloakLoginUrl() usan
  resolveSystemBaseUrl() para el redirect_uri (evita localhost:5173).

- auth/callback/+page.server.ts: idem para el redirectUri del token exchange.

- auth.ts (cliente): resolveKeycloakUrl() detecta en runtime si
  VITE_KEYCLOAK_URL bakeado apunta a localhost pero el browser NO está
  en localhost → deriva la URL del hostname real del browser.

- .env.example: documenta vars de producción recomendadas (SITE_URL,
  ORIGIN, VITE_HUB_URL) con advertencias sobre el efecto de ORIGIN.

Root cause: el .env de dev (ORIGIN=http://localhost:5173,
VITE_KEYCLOAK_URL=http://localhost:8085/kcauth) se usaba en producción
sin sobrescribir estas variables, causando que KC generara URLs con
localhost como redirect_uri y KC URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 08:49:39 -05:00
99cc0bc7ef revert(auth): restaurar client_id a anexo76-frontend
Anexo76 debe tener su propio cliente en Keycloak (no compartir hub-frontend).
Misma sesión SSO para el usuario, pero cliente separado por app.

El cliente anexo76-frontend debe crearse en Keycloak con:
  - Valid redirect URIs: https://anexo76-dev.aduanasoft.com/*
  - Web origins: https://anexo76-dev.aduanasoft.com

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 16:36:43 -05:00
557f904af0 fix(auth): cambiar client_id de Keycloak de anexo76-frontend a hub-frontend
Anexo76 no es independiente del Hub/Workspace — comparten el mismo
cliente de Keycloak (hub-frontend). anexo76-frontend no existe en KC.

- Dockerfile.prod: agrega ARG/ENV VITE_KEYCLOAK_CLIENT_ID=hub-frontend
- workspace-auth.ts: actualiza fallback de 'anexo76-frontend' a 'hub-frontend'
- .env.example: actualiza a hub-frontend
- Jenkinsfile: pasa --build-arg VITE_KEYCLOAK_CLIENT_ID=hub-frontend al build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 15:49:28 -05:00
dacfe8f6e8 docs: update frontend .env.example with all required vars for dev local
Agrega INTERNAL_API_URL, INTERNAL_HUB_URL, HUB_URL, KEYCLOAK_URL y ORIGIN
al ejemplo para que el dev local tenga el mismo conjunto de variables que
usa Docker Compose, evitando que el SSO exchange y el refresh proactivo
fallen silenciosamente por vars indefinidas.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 09:19:24 -05:00
73a535291a feat: implement sidebar components and authentication flow
- Added sidebar menu components including sidebar-menu-item, sidebar-menu-skeleton, sidebar-menu-sub-button, sidebar-menu-sub-item, sidebar-menu-sub, sidebar-menu, sidebar-provider, sidebar-rail, sidebar-separator, sidebar-trigger, and sidebar.
- Introduced skeleton loading states for sidebar items.
- Integrated tooltip components for enhanced user interaction.
- Developed mobile responsiveness using media queries.
- Established authentication flow with Keycloak, including login, logout, and token management.
- Implemented server-side redirection based on authentication status.
- Enhanced error handling and logging for authentication processes.
2025-11-01 20:04:43 -05:00
1961296593 feat(auth): implement OAuth2 exchange code flow for Microsoft login, update environment configurations, and enhance frontend SSO handling 2025-10-20 19:25:29 -05:00
2a10d7d267 feat: Add frontend and backend initialization scripts, implement Keycloak and PostgreSQL setup
- Implemented SvelteKit frontend with authentication callback handling.
- Created demo routes and paraglide localization functionality.
- Added health check and entrypoint scripts for backend services.
- Established PostgreSQL and Keycloak initialization scripts with health checks.
- Introduced models for database schema using SQLAlchemy.
- Configured Vite and SvelteKit for development and testing environments.
- Added health check script to verify service statuses and resource usage.
- Created Docker entrypoint scripts for seamless service startup.
2025-10-19 00:14:06 -05:00