Fetches and validates OIDC well-known configuration.
Pass a custom requestFn to control how the HTTP request is made. When omitted, the built-in Fetch API is used (with a 30-second timeout).
requestFn
The well-known endpoint URL
Optional
Optional custom request function (e.g., RTK Query's baseQuery)
A FetchWellknownResult — either { success: true, data } or { success: false, error }
{ success: true, data }
{ success: false, error }
// Simple — uses built-in fetchconst result = await fetchWellknownConfiguration( 'https://auth.example.com/.well-known/openid-configuration',); Copy
// Simple — uses built-in fetchconst result = await fetchWellknownConfiguration( 'https://auth.example.com/.well-known/openid-configuration',);
// With RTK Query baseQuery — inside a queryFnqueryFn: async (url, _api, _extra, baseQuery) => { const result = await fetchWellknownConfiguration(url, baseQuery); return result.success ? { data: result.data } : { error: result.error };} Copy
// With RTK Query baseQuery — inside a queryFnqueryFn: async (url, _api, _extra, baseQuery) => { const result = await fetchWellknownConfiguration(url, baseQuery); return result.success ? { data: result.data } : { error: result.error };}
Fetches and validates OIDC well-known configuration.
Pass a custom
requestFnto control how the HTTP request is made. When omitted, the built-in Fetch API is used (with a 30-second timeout).