Skip to content

fix: dynamically resolve consumer registration, oidc token and discovery endpoints in auth docs - #2944

Merged
simonredfern merged 4 commits into
OpenBankProject:developfrom
hongwei1:fix/consumer-registration-portal-url
Oct 14, 2026
Merged

simonredfern merged 4 commits into
OpenBankProject:developfrom
hongwei1:fix/consumer-registration-portal-url

Conversation

@hongwei1

@hongwei1 hongwei1 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes issues where authentication documentation rendered on Portal / API Explorer and OpenAPI 3.1 auth schemas contained hardcoded URLs, invalid example endpoints, or placeholders:

  1. Consumer Registration URL & Guide:

    • In OpenAPI31JSONFactory, consumerRegistrationUrl now points to /consumers/register when Portal URL is available, falling back to ${hostname}/consumer-registration.
    • Added consumerCreationGuideUrl (/developers/consumer-creation) and consumerRegistrationInstruction, clarifying Step 1 to guide developers to read the registration instructions, log in, and proceed to /consumers/register to register their application.
    • In APIUtil.getServerUrl, fall back to public_obp_api_url or hostname before raising an exception when documented_server_url is not set.
  2. OIDC Token Endpoint & Discovery Resolution:

    • oAuth2Description previously hardcoded POST <OIDC_provider_token_endpoint>.
    • Added dynamic resolution for oidcTokenEndpoint from oauth2.obp_oidc.host or public_obp_oidc_url (/obp-oidc/token), falling back to <OIDC_provider_token_endpoint> if unconfigured.
    • Added oidcDiscoveryUrl to guide developers to the instance's OIDC discovery document and the GET /obp/v5.1.0/well-known endpoint.
  3. Sample Endpoint Correction:

    • Updated the example requests in directLoginDescription, oAuth2Description, and gatewayLoginDescription from GET /obp/v6.0.0/my/banks (which returns 404) to the valid GET /obp/v7.0.0/my/banks endpoint.
  4. Tests & CI:

    • Updated OpenAPI31FactoryTest to extend ServerSetup with FeatureSpec scenarios, covering fallback and dynamic resolution for consumer registration, guide instructions, OIDC token endpoint, discovery document, sample endpoints, and auth descriptions while adhering to test isolation requirements.

@sonarqubecloud

Copy link
Copy Markdown

@simonredfern
simonredfern merged commit 1413482 into OpenBankProject:develop Oct 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants