File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ VITE_OBP_API_VERSION=v5.1.0
66VITE_OBP_API_EXPLORER_HOST = http://localhost:5173
77
88# ## Session Configuration ###
9- VITE_OPB_SERVER_SESSION_PASSWORD = change-me-to-a-secure-random-string
9+ VITE_OBP_SERVER_SESSION_PASSWORD = change-me-to-a-secure-random-string
1010
1111# ## OAuth2 Redirect URL (shared by all providers) ###
1212VITE_OAUTH2_REDIRECT_URL = http://localhost:5173/api/oauth2/callback
@@ -17,9 +17,13 @@ VITE_OAUTH2_REDIRECT_URL=http://localhost:5173/api/oauth2/callback
1717# VITE_OBP_REDIS_USERNAME=
1818
1919# ## Multi-Provider OAuth2/OIDC Configuration ###
20- # ## The system fetches available providers from: http://localhost:8080/obp/v5.1.0/well-known
20+ # ## If VITE_OBP_OAUTH2_WELL_KNOWN_URL is set, it will be used
21+ # ## Otherwise, the system fetches available providers from: VITE_OBP_API_HOST/obp/v5.1.0/well-known
2122# ## Configure credentials below for each provider you want to support
2223
24+ # ## (Optional) ###
25+ # VITE_OBP_OAUTH2_WELL_KNOWN_URL=http://127.0.0.1:9000/obp-oidc/.well-known/openid-configuration
26+
2327# ## OBP-OIDC Provider ###
2428VITE_OBP_OIDC_CLIENT_ID = your-obp-oidc-client-id
2529VITE_OBP_OIDC_CLIENT_SECRET = your-obp-oidc-client-secret
Original file line number Diff line number Diff line change @@ -66,13 +66,32 @@ export class OAuth2ProviderManager {
6666 }
6767
6868 /**
69- * Fetch well-known URIs from OBP API
69+ * Fetch well-known URIs from OBP API or legacy env variable
7070 *
71- * Calls: GET /obp/v5.1.0/well-known
71+ * Priority:
72+ * 1. VITE_OBP_OAUTH2_WELL_KNOWN_URL (legacy single-provider mode)
73+ * 2. VITE_OBP_API_HOST/obp/v5.1.0/well-known (multi-provider mode)
7274 *
7375 * @returns Array of well-known URIs with provider names
7476 */
7577 async fetchWellKnownUris ( ) : Promise < WellKnownUri [ ] > {
78+ // Check for legacy single-provider configuration
79+ const legacyWellKnownUrl = process . env . VITE_OBP_OAUTH2_WELL_KNOWN_URL
80+
81+ if ( legacyWellKnownUrl ) {
82+ console . log ( 'OAuth2ProviderManager: Using legacy VITE_OBP_OAUTH2_WELL_KNOWN_URL...' )
83+ console . log ( `OAuth2ProviderManager: Well-known URL: ${ legacyWellKnownUrl } ` )
84+
85+ // Return single provider configuration
86+ return [
87+ {
88+ provider : 'obp-oidc' ,
89+ url : legacyWellKnownUrl
90+ }
91+ ]
92+ }
93+
94+ // Multi-provider mode: fetch from OBP API
7695 console . log ( 'OAuth2ProviderManager: Fetching well-known URIs from OBP API...' )
7796
7897 try {
You can’t perform that action at this time.
0 commit comments