Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omejdn DAPS: Contract negotiation fails when using the EDC oauth2-daps extension #654

Closed
epanagou-ubitech opened this issue Nov 21, 2023 · 4 comments
Assignees
Labels
kind/bug Something isn't working. The software does not behave as expected or specified.

Comments

@epanagou-ubitech
Copy link

epanagou-ubitech commented Nov 21, 2023

Bug Report

Description

In our setup we use omejdn-daps and we have rebuilt the ghcr.io/sovity/edc-dev:5.0.0 image with the oauth2-daps extension enabled like so:

File: launchers/common/base-prod/build.gradle.kts

  dependencies {
      // OAuth2 IAM
      api("${edcGroup}:oauth2-core:${edcVersion}")
+     api("${edcGroup}:oauth2-daps:${edcVersion}")
      api("${edcGroup}:vault-filesystem:${edcVersion}")
  }

Creating assets, usage policies and contract definitions works smoothly but contract negotiations fail.

Expected Behavior

We expect that the contract negotiation will complete.

Observed Behavior

Instead, the contract negotiation hangs and we notice the following error in the logs of the provider:

ContractNegotiation: ID 5490e9ed-3c88-4f5c-9885-2090961513e9. Fatal error while [Provider] send agreement. Error details: {"@type":"dspace:ContractNegotiationError","dspace:code":"400","dspace:reason":"Contract agreement received. Validation failed: Invalid provider credentials","dspace:processId":"a7d66e5a-33be-4d80-b42d-0cddffbb880c","@context":{"dct":"https://purl.org/dc/terms/","edc":"https://w3id.org/edc/v0.0.1/ns/","dcat":"https://www.w3.org/ns/dcat/","odrl":"http://www.w3.org/ns/odrl/2/","dspace":"https://w3id.org/dspace/v0.8/"}}

Steps to Reproduce

Steps to reproduce the behavior:

  1. Add the oauth2-daps extension to build.gradle.kts (as shown above) and rebuild the image

    docker build . -f launchers/Dockerfile -t test-edc-daps
    
  2. Configure docker-compose and .env

    • Generate a SKI/AKI pair and .jks file and place it in a new secrets directory at the root directory of the project.

    • At the bottom of .env put:

      EDC_IMAGE=test-edc-daps
      DAPS_URL="http://<DAPS IP AND PORT>/auth"
      EDC_OAUTH_CLIENT_ID="<YOUR CLIENT ID>"
      EDC_KEYSTORE_PASSWORD="<YOUR KEYSTORE PASSWORD>"
      
    • In docker-compose.yaml, both in edc and edc2 add:

      EDC_OAUTH_CLIENT_ID: ${EDC_OAUTH_CLIENT_ID}
      EDC_OAUTH_TOKEN_URL: ${DAPS_URL}/token
      EDC_OAUTH_PROVIDER_JWKS_URL: ${DAPS_URL}/jwks.json
      EDC_KEYSTORE: /secrets/keystore.jks
      EDC_KEYSTORE_PASSWORD: ${EDC_KEYSTORE_PASSWORD}
      EDC_OAUTH_CERTIFICATE_ALIAS: 1
      EDC_OAUTH_PRIVATE_KEY_ALIAS: 1
      

      And:

      volumes:
        - ./secrets:/secrets
      
  3. Start the connectors

    docker-compose up
    
  4. On the provider, create an asset and contract definition.

  5. On the consumer, go to Catalog Browser, select the asset and attempt to negotiate.

  6. Negotiation should hang, with the loading animation playing continuously.

  7. Check the provider logs and see the Invalid provider credentials error.

Context Information

  • Used version: ghcr.io/sovity/edc-dev:5.0.0 with the oauth2-daps extension, and ghcr.io/sovity/edc-ui:2.0.0 for the UI
  • OS: Linux
@epanagou-ubitech epanagou-ubitech added the kind/bug Something isn't working. The software does not behave as expected or specified. label Nov 21, 2023
@tmberthold
Copy link
Contributor

tmberthold commented Nov 29, 2023

Just a few quick notes from my side:

  • for security reasons, I would strongly recommend to not rely on the Omejdn DAPS, since the last release is from June 2022 and has not been maintained since then: Link
  • the image ghcr.io/sovity/edc-dev:5.0.0 is referenced in two places in the issue, this dev-version does not contain an IAM connection/extension, it uses an IAM-mock instead. Instead, the base-prod launcher is expanded in the issue, which corresponds to the actual EDC CE.
  • if the goal of this issue is to connect to the MDS, then please use their current CE versions, they are currently using a sovity EDC CE v4.2.1, then we would not need to investigate this issue further: MDS Versions-Table

@epanagou-ubitech
Copy link
Author

Thank you for the information!

We are not trying to connect to the MDS, we are trying to set up our own separate data space.
In that case, what would be a good alternative to the Omejdn DAPS?

@tmberthold
Copy link
Contributor

tmberthold commented Dec 5, 2023

Thank you for the information!

We are not trying to connect to the MDS, we are trying to set up our own separate data space. In that case, what would be a good alternative to the Omejdn DAPS?

I have forwarded this internally and we will get back to you about this as soon as possible.
In principle, there is also a more modern Keycloak DAPS approach if you want to use a DAPS and not a (central) MIW.

//cc: @jkbquabeck

@tmberthold tmberthold transferred this issue from sovity/edc-ui Dec 5, 2023
@richardtreier richardtreier changed the title Contract negotiation fails when using the EDC oauth2-daps extension Omejdn DAPS: Contract negotiation fails when using the EDC oauth2-daps extension Dec 5, 2023
@richardtreier
Copy link
Collaborator

richardtreier commented Dec 7, 2023

Hi,

together with our Release v7.0.0 and this Omejdn Documentation in our Productive Deployment Guide, this issue should now be resolved. Please note that there is still a time skew issue in the Eclipse EDC that can cause Contract Negotiations to fail with certificate errors.

Please re-open the issue if your issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working. The software does not behave as expected or specified.
Projects
None yet
Development

No branches or pull requests

4 participants