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

Need authenticate func #7

Closed
gtolarc opened this issue Jun 24, 2020 · 6 comments
Closed

Need authenticate func #7

gtolarc opened this issue Jun 24, 2020 · 6 comments

Comments

@gtolarc
Copy link

gtolarc commented Jun 24, 2020

ual-scatter has the following authenticate implementation:
https://github.com/EOSIO/ual-scatter/blob/master/src/ScatterUser.ts#L111

This is useful when receiving user signup from a centralized server, separate from client-wallet communication.
This is because sending a signature, data, nonce, and publicKey to the server enables data validation with the ecc.recoverHash command.
Can you provide a function to verify the possession of a private key through a signature like this?

@aaroncox
Copy link
Member

The login process in ual-anchor does already verify the possession of a private key and return a proof through the use of identity requests as it uses anchor-link to call the identify method.

The proofs are returned via the callback method, which could also be listened for on a centralized server.

It doesn't look like we're exposing that proof right now in UAL though, which is returned as identity in this part of ual-anchor. We'll add that information to the returned AnchorUser object so that other applications can also verify the signature being returned and provide proof of ownership.

@gtolarc
Copy link
Author

gtolarc commented Jun 25, 2020

I confirmed that I can get the desired value by returning the login function manually. As you mentioned, it would be really nice to add the return content to the anchorUser object at the login.

@gtolarc
Copy link
Author

gtolarc commented Aug 6, 2020

We'll add that information to the returned AnchorUser object so that other applications can also verify the signature being returned and provide proof of ownership.

When can you implement this part? @aaroncox

@aaroncox
Copy link
Member

aaroncox commented Aug 6, 2020

Sorry for the delay, we had a few external things impacting us getting back on top of UAL.

I pushed this up on my priorities list, I'll see if we can get it exposed soon in a new release of ual-anchor.

@aaroncox
Copy link
Member

Alright, ual-anchor@0.5.1 is published now and does expose the proofs themselves.

I have also updated our ual-reactjs-renderer-demo-multipass repository to include how to verify these proofs, which can be found here:

https://github.com/greymass/ual-reactjs-renderer-demo-multipass/blob/0c71aec6de6882162ba75db87dbc01efed693bb5/src/Main.js#L33-L51

The proof itself is not persisted and is only available upon initial login, so additional checks are needed to see if the proof exists before validating it.

@gtolarc
Copy link
Author

gtolarc commented Aug 10, 2020

thx!! @aaroncox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants