Implement authentication phase with Cidaas OAuth2 integration

- Add authentication middleware to protect routes
- Create API endpoints for login, logout, registration, and user info
- Develop UI components for login and registration forms
- Integrate VeeValidate for form validation
- Update environment configuration for Cidaas settings
- Add i18n support for English and German languages
- Enhance Tailwind CSS for improved styling of auth components
- Document authentication flow and testing procedures
This commit is contained in:
Bastian Masanek
2025-10-31 11:44:48 +01:00
parent 749d5401c6
commit f8572c3386
57 changed files with 3357 additions and 132 deletions

View File

@@ -24,12 +24,25 @@ export default defineNuxtConfig({
},
// Modules
modules: ['@nuxtjs/tailwindcss', 'shadcn-nuxt', '@nuxt/eslint'],
modules: ['nuxt-auth-utils', '@nuxtjs/tailwindcss', 'shadcn-nuxt', '@nuxt/eslint'],
// i18n configuration (temporarily disabled for debugging)
// i18n: {
// locales: [
// { code: 'de', language: 'de-DE', file: 'de-DE.json', name: 'Deutsch' },
// { code: 'en', language: 'en-US', file: 'en-US.json', name: 'English' },
// ],
// defaultLocale: 'de',
// lazy: true,
// langDir: 'locales',
// strategy: 'prefix_except_default',
// vueI18n: './i18n.config.ts',
// },
// shadcn-nuxt configuration
shadcn: {
prefix: '',
componentDir: './components/ui',
componentDir: './app/components/ui',
},
// Runtime configuration
@@ -41,6 +54,25 @@ export default defineNuxtConfig({
internalAuthUsername: process.env.INTERNAL_AUTH_USERNAME || '',
internalAuthPassword: process.env.INTERNAL_AUTH_PASSWORD || '',
// Cidaas OAuth2 Configuration
cidaas: {
clientId: process.env.CIDAAS_CLIENT_ID,
clientSecret: process.env.CIDAAS_CLIENT_SECRET,
issuer: process.env.CIDAAS_ISSUER,
authorizeUrl: process.env.CIDAAS_AUTHORIZE_URL,
tokenUrl: process.env.CIDAAS_TOKEN_URL,
userinfoUrl: process.env.CIDAAS_USERINFO_URL,
jwksUrl: process.env.CIDAAS_JWKS_URL,
redirectUri: process.env.CIDAAS_REDIRECT_URI,
},
// Session configuration
session: {
maxAge: 60 * 60 * 24 * 30, // 30 days in seconds
name: 'experimenta-session',
password: process.env.NUXT_SESSION_SECRET || '',
},
// Public (exposed to client)
public: {
appUrl: process.env.APP_URL || 'http://localhost:3000',
@@ -52,4 +84,17 @@ export default defineNuxtConfig({
strict: true,
typeCheck: false, // Disabled for now, will enable in later phases with vue-tsc
},
})
// Security headers for auth routes
nitro: {
routeRules: {
'/api/auth/**': {
headers: {
'X-Frame-Options': 'DENY',
'X-Content-Type-Options': 'nosniff',
'Referrer-Policy': 'strict-origin-when-cross-origin',
},
},
},
},
})