industrial-data-space / idscp2-jvm

Kotlin implementation of the IDS Communication Protocol (IDSCP2) for use in JVM environments.
Apache License 2.0
5 stars 3 forks source link

DapsDriver adds hardcoded `/v2/token` to Daps URL #7

Closed kragall closed 2 years ago

kragall commented 2 years ago

Describe the bug The CH uses this library to get a token from the DAPS that it can include in its responses to connectors. With a custom DAPS the retrieval of tokens fails if it is deployed such that the token url does not end in /v2/token.

To Reproduce Steps to reproduce the behavior:

  1. Deploy DAPS with token url not ending in /v2/token
  2. Try to get a token

Expected behavior Do not change token url in the driver class

Screenshots and logs None

Additional context In line 210 of the AisecDapsDriver there is the /v2/token added to the url (https://github.com/industrial-data-space/idscp2-java/blob/develop/idscp2/src/main/kotlin/de/fhg/aisec/ids/idscp2/default_drivers/daps/aisec_daps/AisecDapsDriver.kt)

milux commented 2 years ago

Has been fixed with release 0.9.0. AISEC DAPS driver now queries metadata from <DAPS-URL>/.well-known/oauth-authorization-server. If not available, the DAPS driver falls back to defaults as follows:

Issuer: https://<DAPS URL host> JWKS: <DAPS URL>/.well-known/jwks.json Token Endpoint: <DAPS URL>/token