org.eclipse.edc.spi.EdcException: Unable to obtain credentials: MIW API returned 401 #832
Replies: 3 comments 6 replies
-
not sure if it's the case but is the service account enabled? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer! So you mean the curl-command should look like this?
Because then the Swagger UI is simply answering:
The curl-command I posted before does give me access to the API at least. I got it from here. Or is that one outdated? Regarding the Service Account: Do you mean the Service Account belonging to the miw_private_client in Keycloak? |
Beta Was this translation helpful? Give feedback.
-
As a follow-up question, now that the EDCs are able to communicate with the MIW: what's the minimalistic amount of steps I have to take to make the Provider- and Consumer-EDC communicate with each other successfully? I suppose the first step would be to create respective wallets for the Provider and Consumer, which I did by using
with
and
and updating the connector configurations. Now I receive the following error message from the Consumer EDC:
So this probably means that I have to store some VCs in my wallet first, but using
with, say, identifier=BPNL000000000001, simply yields
|
Beta Was this translation helpful? Give feedback.
-
We're currently working with a docker compose network containing several services, such as two different EDCs, Keycloak, Postgres, MIW and a couple of others. The MIW is connected to Keycloak and Postgres by setting the respective environment variables as well as by importing this realm into Keycloak and running this script for the database. The EDCs contain all of the SSI modules, but not anything else that is specific to the Tractus-X-EDC:
All the applications start without an issue and I can succesfully connect to the Swagger UI of the MIW by authorizing with a Bearer token that I receive as a result of this command (though I suppose this isn't related to the actual problem):
Unfortunately, when I start a Contract Negotation and the Consumer EDC tries to talk to the MIW, I always receive the following error:
Error logs
DEBUG 2023-10-17T11:12:36.525144133 ContractNegotiation: ID f969c4a1-7682-4ee9-a642-47de1d61b057. Attempt #1 failed to [Consumer] Send ContractRequestMessage message. Cause: Unable to obtain credentials: MIW API returned 401 org.eclipse.edc.spi.EdcException: Unable to obtain credentials: MIW API returned 401 at org.eclipse.edc.protocol.dsp.dispatcher.DspHttpRemoteMessageDispatcherImpl.lambda$dispatch$2(DspHttpRemoteMessageDispatcherImpl.java:124) at org.eclipse.edc.spi.result.AbstractResult.orElse(AbstractResult.java:105) at org.eclipse.edc.protocol.dsp.dispatcher.DspHttpRemoteMessageDispatcherImpl.dispatch(DspHttpRemoteMessageDispatcherImpl.java:124) at org.eclipse.edc.connector.core.base.RemoteMessageDispatcherRegistryImpl.dispatch(RemoteMessageDispatcherRegistryImpl.java:48) at org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImpl.lambda$processRequesting$0(ConsumerContractNegotiationManagerImpl.java:135) at org.eclipse.edc.statemachine.retry.CompletableFutureRetryProcess.process(CompletableFutureRetryProcess.java:50) at org.eclipse.edc.statemachine.retry.RetryProcess.execute(RetryProcess.java:71) at org.eclipse.edc.connector.contract.negotiation.ConsumerContractNegotiationManagerImpl.processRequesting(ConsumerContractNegotiationManagerImpl.java:141) at org.eclipse.edc.spi.telemetry.Telemetry.lambda$contextPropagationMiddleware$0(Telemetry.java:73) at org.eclipse.edc.statemachine.ProcessorImpl.lambda$process$1(ProcessorImpl.java:55) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.ReduceOps$5.evaluateSequential(ReduceOps.java:258) at java.base/java.util.stream.ReduceOps$5.evaluateSequential(ReduceOps.java:248) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.count(ReferencePipeline.java:709) at org.eclipse.edc.statemachine.ProcessorImpl.process(ProcessorImpl.java:62) at java.base/java.util.stream.ReferencePipeline$5$1.accept(ReferencePipeline.java:231) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.LongPipeline.reduce(LongPipeline.java:498) at java.base/java.util.stream.LongPipeline.sum(LongPipeline.java:456) at org.eclipse.edc.statemachine.StateMachineManager.performLogic(StateMachineManager.java:110) at org.eclipse.edc.statemachine.StateMachineManager.lambda$loop$2(StateMachineManager.java:101) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
I tried it with a couple of different configurations for the EDC, but it kinda looks like this:
I'm honestly not sure whether I did it right or not but of course I tried to create a wallet and credentials first with BPNL000000000001 etc. Could the issue be related to not filling the MIW with the right values? Or is it a configuration issue on the connector side? A similar discussion can be found here but there hasn't been any answer to it and the setup is different from ours since we don't use the Sokrates and Plato connectors.
Beta Was this translation helpful? Give feedback.
All reactions