i2goSignals

goSignals

OIDC/OAuth Implementation Summary

This document summarizes the OIDC/OAuth authentication integration implemented for the GoSignals administrative interface.

What Was Implemented

1. Backend (goSignalsServer)

OIDC Discovery Endpoint

Token Validation

2. Keycloak Configuration

Realm Configuration

3. Frontend (adminUI)

Authentication Library

Auth Configuration

Auth Context

UI Components

Callback Page

Silent Callback

API Client

Application Updates

4. Documentation

Key Features

1. OIDC/OAuth Login Integration

2. Federated Sign-In

3. Login State Tracking

4. Login/Logout UI

5. Authorization Token Handling

6. OIDC Discovery

7. Token Validation

Architecture Flow

1. User accesses adminUI (http://localhost:8899)
2. User clicks "Login" button
3. adminUI redirects to Keycloak (https://keycloak:9080/realms/gosignals)
4. User enters credentials on Keycloak page
5. Keycloak redirects back to adminUI with authorization code
6. adminUI exchanges code for tokens (access_token, refresh_token, id_token)
7. adminUI stores tokens in sessionStorage
8. User info displayed in header
9. API requests to goSignalsServer include bearer token
10. goSignalsServer validates token with Keycloak's public key
11. Before token expiration, adminUI silently refreshes token
12. On logout, adminUI clears tokens and redirects to Keycloak logout

Environment Variables

goSignalsServer

adminUI (Vite)

Files Created/Modified

Created

  1. internal/server/api_stream_management.go - Added OidcConfiguration handler
  2. internal/authUtil/auth_token.go - Added OIDC token validation
  3. config/keycloak/realm/gosignals-realm.json - Keycloak realm configuration
  4. adminUI/src/lib/auth/authConfig.ts - OIDC client configuration
  5. adminUI/src/lib/auth/AuthContext.tsx - Auth state management
  6. adminUI/src/lib/apiClient.ts - API client with token interceptor
  7. adminUI/src/components/UserMenu.tsx - Login/logout UI component
  8. adminUI/src/components/AuthCallback.tsx - OAuth callback handler
  9. adminUI/public/silent-callback.html - Silent token renewal page
  10. adminUI/OIDC_SETUP.md - Setup and usage documentation
  11. OIDC_IMPLEMENTATION.md - This summary document

Modified

  1. internal/server/routers.go - Added OIDC discovery route
  2. adminUI/package.json - Added oidc-client-ts and axios dependencies
  3. adminUI/src/App.tsx - Added UserMenu to header
  4. adminUI/src/main.tsx - Added AuthProvider wrapper and routing

Testing

To test the implementation:

  1. Start services:
    docker-compose up -d
    
  2. Access adminUI: http://localhost:8899

  3. Test login:
    • Click “Login” button
    • Enter credentials: admin/admin
    • Verify redirect back to adminUI
    • Check user avatar shows in header
  4. Test API calls:
    • Open browser dev tools
    • Navigate to different sections
    • Check Network tab for API requests
    • Verify Authorization header includes bearer token
  5. Test logout:
    • Click user avatar
    • Select “Log out”
    • Verify redirect to login page

Security Notes

  1. PKCE enabled: Protects against authorization code interception
  2. Public client: No client secret (appropriate for SPA)
  3. Token storage: sessionStorage (cleared on browser close)
  4. HTTPS recommended: For production deployments
  5. CORS configuration: Ensure proper CORS settings for production

Next Steps

For production deployment:

  1. Configure HTTPS for all services
  2. Use production-grade Keycloak configuration
  3. Set up proper database for Keycloak (not included in basic setup)
  4. Configure appropriate token lifetimes
  5. Set up proper CORS policies
  6. Configure rate limiting and brute force protection
  7. Review and harden Keycloak security settings
  8. Set up monitoring and logging for authentication events

Support

For detailed setup instructions and troubleshooting, see adminUI/OIDC_SETUP.md.


(C)2026 Independent Identity Inc.