FuzzyShareDOCS
Agent prompt Sign up

Self-hosting

Sign in with GitHub and Google

Let people sign in with GitHub or Google, and what the server does with their account.

FuzzyShare signs people in with an access key. You can also let them sign in with GitHub or Google. It is off until you give the server a client id and secret for a provider, and the two providers are independent.

What it does#

  1. The person clicks Continue with GitHub or Continue with Google.
  2. The provider asks them to approve. FuzzyShare asks only for their name and email address.
  3. The server finds the account with that email address, or makes one, and gives the browser an access key.

Only an email address the provider has verified counts. An account is matched by that address, ignoring case. A person who signed up with a key and later signs in with GitHub lands in the same account, with the same files.

The key is handed to the page in the address fragment (#k=...), which never reaches a server or a log, and the page removes it from the address bar at once. Each provider holds one key per account, named GitHub or Google. Signing in again replaces it, so the browser that used the older one is signed out. Revoke it on the Keys page like any other key.

Set it up#

Register an OAuth app with each provider you want. The callback address is where the server receives the answer. If you set FUZZY_APP_HOST, it is on that host.

Provider Where Callback address
GitHub Settings, Developer settings, OAuth Apps https://app.example.com/auth/github/callback
Google Google Cloud Console, APIs and Services, Credentials, OAuth client ID (Web application) https://app.example.com/auth/google/callback

Without an app host, use your main address: https://example.com/auth/github/callback.

For Google, set the consent screen's scopes to openid, email and profile. Then give the server the credentials:

FUZZY_GITHUB_CLIENT_ID=...
FUZZY_GITHUB_CLIENT_SECRET=...
FUZZY_GOOGLE_CLIENT_ID=...
FUZZY_GOOGLE_CLIENT_SECRET=...

Each id and secret go together: set both or neither, or the server will not start. Restart the server. GET /config then lists the providers in oauth, and the buttons on the sign-in page start working.

Good to know#

  • With FUZZY_SIGNUP_CODE set, a provider cannot create new accounts, because that would skip the code. An existing account can still sign in with it.
  • New accounts count towards the signup limit per address, like any other signup.
  • A deactivated account stays deactivated.
  • A provider needs no email confirmation: GitHub and Google have already verified the address. With email confirmation on, nobody can register an address they do not own, so signing in with a provider cannot land in someone else's account. Without it, someone could register an address with a key before its owner arrives, and the owner's later sign-in would reach that account.
  • The server keeps no provider tokens. It uses them once to read the name and address, then drops them.

View this page as Markdown