Skip to content

Commit 755749a

Browse files
committed
rename env variable for OBP consumer key
1 parent f8f69fb commit 755749a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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).
3838
OBP_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

src/mcp_server_obp/server.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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")

0 commit comments

Comments
 (0)