silverbullet icon indicating copy to clipboard operation
silverbullet copied to clipboard

GitHub login

Open Willyfrog opened this issue 3 years ago • 5 comments

Added github login, now using passportjs for authentication.

To use add [--github allowedGitHubLogin] to allow for a single account to log in as there is no support for multiuser.

What's left:

  • [x] improve doc to explain how to setup a github app.
  • [ ] improve go to github page (currently it is a blank page with a link to it).
  • [ ] use SB_GITHUB_ALLOWED_USER instead of arg

But submitting for review as it is a bit big and might take some time and it is currently working so we could start using it right away. I'll address the above either in this pr or a separate one.

Future improvements:

  • use other oauth providers and find a way to differentiate between them
  • figure out a better way to see if a password user has already authenticated (via sessions)

Willyfrog avatar Aug 19 '22 12:08 Willyfrog

fixes https://github.com/silverbulletmd/silverbullet/issues/16

Willyfrog avatar Aug 19 '22 13:08 Willyfrog

Oh my this is cool! Will check it out once I'm back at a proper computer. If there's a way to do generic oauth flows also for the purposes of getting tokens inside plugs that would be super awesome as well. I'd be interested in getting this auth token available to the silverbullet-GitHub plug for instance.

zefhemel avatar Aug 20 '22 07:08 zefhemel

I'd be interested in getting this auth token available to the silverbullet-GitHub plug for instance.

it would be on the client, but for the server I think it needs some sort of different workflow.

Willyfrog avatar Aug 23 '22 11:08 Willyfrog

Idea: How about a --github-auth flag (with no value) and supply SB_GITHUB_ALLOWED_USER as env variable too?

I'll add it to the list of todos to fix in this PR

Willyfrog avatar Aug 29 '22 13:08 Willyfrog

This is cool. A bit of a hassle to setup still, but that's probably unavoidable. Still struggling to think how to supply tokens and configuration. Now it's a bit of a random mix of env variables and a github handle.

yeah, we can probably make use of only env vars as suggested, but we need the three items so it's either a config file or env vars.

Willyfrog avatar Aug 29 '22 13:08 Willyfrog

Closing this in agreement with @Willyfrog . Needs a redo now that SB is based on Deno, unfortunately.

zefhemel avatar Nov 23 '22 11:11 zefhemel