amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.14k stars 1.17k forks source link

[Question] - Is there a way to authenticate using Oauth? #1180

Closed mbround18 closed 2 years ago

mbround18 commented 2 years ago

I was wondering, is there a way to authenticate using Oauth?

mbround18 commented 2 years ago

hello?

rococtz commented 2 years ago

You can authenticate with anything you want, but that centralizes the app which defeats the purpose of building a decentralized app. It's possible, but not out of the box, you have to implement it yourself.

mbround18 commented 2 years ago

You can authenticate with anything you want, but that centralizes the app which defeats the purpose of building a decentralized app. It's possible, but not out of the box, you have to implement it yourself.

True but in todays world, its hard not building apps with common features like oauth or similar strategies. Any pointers for how to override the auth methods to be able to write in the users space?

rococtz commented 2 years ago

@mbround18 Not sure what kind of pointers you can get other than "clone the repo, open the source code and modify the authentication to implement your own". Maybe this will help: gun.user().auth() can be used with alias and password, but it can also be used with a pair ( https://gun.eco/docs/SEA#pair ). Option 1: You can have your own oAuth server that generates that pair. Option 2: You let users sign up with Gun and then you manually link them in your server which will generate a signed message which can be used to verify that your server approves of these users.

The problem is that if you go this way, why even bother using Gun? You are centralizing it which means you lose the benefits of decentralization.

amark commented 2 years ago

@mbround18 👏 @rococtz . If you build it, please publish it for the community - I'm sure others would be interested! Closing (issues are for bugs, chat is for Qs).