mattrglobal / osma

An open source mobile agent for achieving SSI
Apache License 2.0
40 stars 29 forks source link

Osma Edge agent Communication with Mediator cloud agent #42

Closed naman20sharma closed 4 years ago

naman20sharma commented 4 years ago

Using MediatorAgent Service in aries-framework-dotnet/samples/routing/MediatorAgentService I started the MediatorAgent on http://localhost:5000 and provided this URI as endpoint for Osma Mobile application.

Wanted to understand the role and requirement of a Mediator Cloud agent for A2A connection i.e between Osma app with agents running on aries-framework-dotnet (after executing ./start-web-agents.sh).

Also, how to issue credentials after successful establishment of connection.

kdenhartog commented 4 years ago

A Mediator Cloud agent is intended to be used as a highly available service that senders can use to drop off for the mobile agent (OSMA). See here for additional details: https://github.com/hyperledger/aries-rfcs/tree/master/concepts/0046-mediators-and-relays

As for kicking off the issue credentials flow, I'll defer to @tplooker or @sukalpomitra for that.

sukalpomitra commented 4 years ago

@naman20sharma once you have successfully created connections with an issuer and verifier. The issuer should send you a credential offer. Once you accept the offer, the issuer then issues the credential. The verifier then sends you a proof request and you supply the attributes of the proof request with the credentials that you have in your wallet (edge agent). Then you accept the proof request which generates the proof json and sends to the verifier which then the verifier then validates.

naman20sharma commented 4 years ago

@naman20sharma once you have successfully created connections with an issuer and verifier. The issuer should send you a credential offer. Once you accept the offer, the issuer then issues the credential. The verifier then sends you a proof request and you supply the attributes of the proof request with the credentials that you have in your wallet (edge agent). Then you accept the proof request which generates the proof json and sends to the verifier which then the verifier then validates.

@sukalpomitra After Connecting successfully with the cloud agent, I'm not getting any credential offer, how to get it and who is issuer and verifier in this case, I'm following the quick Demo given in https://github.com/mattrglobal/osma/blob/master/README.md , wanted to know how this flow works that you mentioned (Credentials offer and the proof request).

naman20sharma commented 4 years ago

Hi @sukalpomitra @kdenhartog @tplooker , I'll just brief you a bit with what I am trying to achieve here, when I raised this issue :

  1. I started a MediatorAgent on http://localhost:5000 and provided this URI as endpoint for Osma Mobile application. The Mediator is here: https://github.com/hyperledger/aries-framework-dotnet/blob/master/samples/routing/MediatorAgentService/Startup.cs. After assigning this mediator agent as endpoint for Osma the application fails to connect with the Cloud agent (any one out of two aries-framework-dotnet agents). The reason why I am trying this is to issue verifiable credentials and communication between two edge agents. Is this approach correct ? If not then what possible solution is there for issuing credentials between two agents ?

    1. Do I need to Register Osma Edge agent as services.AddAriesFramework(builder => builder.RegisterEdgeAgent(...) , refer: https://dev.azure.com/streetcred/Hyperledger.Aries/_git/aries-xamarin-forms-sample?path=%2Fsrc%2FWallet%2FApp.xaml.cs In this sample methodology for registering the edge agent is different then Osma (where RegisterViewModel is being used and AriesFramework is added here https://github.com/mattrglobal/osma/blob/master/src/Osma.Mobile.App.Services/ServicesModule.cs).
sukalpomitra commented 4 years ago

CCing @tmarkovski

tmarkovski commented 4 years ago
1. I started a MediatorAgent on http://localhost:5000 and provided this URI as endpoint for Osma Mobile application. The Mediator is here: https://github.com/hyperledger/aries-framework-dotnet/blob/master/samples/routing/MediatorAgentService/Startup.cs. After assigning this mediator agent as endpoint for Osma the application fails to connect with the Cloud agent (any one out of two aries-framework-dotnet agents). The reason why I am trying this is to issue **verifiable credentials** and communication between two edge agents. Is this approach correct ? If not then what possible solution is there for issuing credentials between two agents ?

Yes this is correct. In case you're testing it from a mobile device, this URL should be an ngrok address.

2. Do I need to Register Osma  Edge agent as `services.AddAriesFramework(builder => builder.RegisterEdgeAgent(...)` , refer: https://dev.azure.com/streetcred/Hyperledger.Aries/_git/aries-xamarin-forms-sample?path=%2Fsrc%2FWallet%2FApp.xaml.cs

Yes. The provided mediator support in Aries .NET requires that edge agents be provisioned using RegisterEdgeAgent and passing the mediator URL as EndpointUri. This will take care of connecting and configuring to the running mediator agent.

   In this sample methodology for registering the edge agent is different then Osma (where RegisterViewModel is being used and AriesFramework is added here https://github.com/mattrglobal/osma/blob/master/src/Osma.Mobile.App.Services/ServicesModule.cs).

The support for mediators was added much later compared to when Osma was first created. The code needs an update.

naman20sharma commented 4 years ago

The support for mediators was added much later compared to when Osma was first created. The code needs an update.

okay, thanks for this info.

tmarkovski commented 4 years ago

It'll be updated in the hyperledger repo. You should probably mark this repo as archived and point to the migrated one.

kdenhartog commented 4 years ago

Yup, we've got that work planned to be done within the next week.

tplooker commented 4 years ago

@naman20sharma as indicated by @tmarkovski and @kdenhartog, this repo will be living on at https://github.com/hyperledger/aries-mobileagent-xamarin so please continue the conversation on this issue there. I am going to archive this repository today and hence will be closing this issue