File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ OBP_OIDC_ISSUER_URL=http://localhost:9000/obp-oidc
3737# - "none": No authorization method is used. OBP-API calls are made but with limited access (only public endpoints).
3838OBP_AUTHORIZATION_VIA = " none" # Options: "oauth", "consent", "none"
3939
40+ # OBP API consumer key that opey uses (required for "consent" authorization method with opey)
41+ OPEY_OPEY_OBP_CONSUMER_KEY = " obp-opey-ii-client"
42+
4043# Multi-issuer bearer-only mode:
4144# Set BOTH KEYCLOAK_REALM_URL and OBP_OIDC_ISSUER_URL with AUTH_PROVIDER=bearer-only
4245# to accept tokens from either identity provider. The server will route validation
Original file line number Diff line number Diff line change @@ -234,6 +234,13 @@ async def call_obp_api(
234234 f"Please approve and provide a Consent-JWT." ,
235235 }, indent = 2 )
236236 request_headers ["Consent-JWT" ] = consent_jwt
237+
238+ consumer_key = os .getenv ("OPEY_OBP_CONSUMER_KEY" )
239+ if consumer_key :
240+ request_headers ["Consumer-Key" ] = consumer_key
241+ else :
242+ logger .warning ("OPEY_OBP_CONSUMER_KEY is not set in environment variables. Consent-based authorization will fail without it." )
243+
237244 case "none" :
238245 # No authorization
239246 logger .info ("No authorization method used for OBP API call" )
You can’t perform that action at this time.
0 commit comments