Rezin Core Rezin Core Docs Sign in

Authentication

Sign in with Google or GitHub

Both are off for a new project. Switch one on under Authentication → Sign-in methods, and list the addresses people may be sent back to under URL configuration.

The flow

your app ──▶ api.rezincore.com/v1/auth/authorize/google ──▶ Google
                                                              │
your app ◀── ?code=<one-time code> ◀── api.rezincore.com ◀────┘
   │
   └─▶ POST /v1/auth/exchange  ──▶  a session token

1. Send the person's browser to Rezin Core

https://api.rezincore.com/v1/auth/authorize/google?project=<project ID>&redirect_to=https://app.example.com/signed-in

Use github in place of google for GitHub. redirect_to must be on the project's list; without it the Site URL is used. An address that is not listed is refused before the person is sent anywhere.

2. They come back to your address

With ?code=<one-time code> on success, or ?error=<reason>:

errorMeaning
cancelledThe person backed out, or the provider reported an error
not_verifiedThe provider did not vouch for a verified email address
no_accountNobody in this project has that identity or email, and self sign-up is off
disabledThe account is disabled
not_configuredThe provider is not set up

3. Swap the code for a session

From your page or your server, with your project key, within two minutes:

curl -s https://api.rezincore.com/v1/auth/exchange \
  -H "apikey: $KEY" -H "content-type: application/json" -d '{"code":"<one-time code>"}'

The answer has the same shape as POST /v1/auth/signin. The code works once and only with a key of the same project.

If the account uses an authenticator app the answer is 401 code_required: send the same request again with "secondStepCode": "123456" added. See Authenticator app.

StatusCodeWhen
401bad_codeThe one-time code has expired or was already used
401code_requiredThe account uses an authenticator app
401bad_second_stepThe authenticator code is not right

Which account a person gets

  1. The account already linked to that provider identity, if there is one.
  2. Otherwise the account in this project whose email equals the address the provider says is verified. It is linked from then on.
  3. Otherwise a new account, only if the project allows self sign-up. It joins the organization the project names and has no password.

A disabled account is refused before anything is linked to it.

Whose provider app is used

Rezin Core has its own app with each provider. A project that switches a provider on uses it unless the project supplies its own. With Rezin Core's app, the provider's consent screen names Rezin Core, not your application.

To use your own app:

  1. Create an OAuth app with the provider and register this callback address exactly:
ProviderCallback address
Googlehttps://api.rezincore.com/v1/auth/callback/google
GitHubhttps://api.rezincore.com/v1/auth/callback/github
  1. Put its client ID in the project's Sign-in methods.
  2. Put its client secret in the project's Secrets under exactly this name: GOOGLE_CLIENT_SECRET or GITHUB_CLIENT_SECRET.

What is kept

Exactly two things from the provider: its own ID for the person, and an email address it says is verified (for GitHub, one marked primary and verified). The provider's token is used once in memory and never stored. Rezin Core does not read the person's repositories, mail, files or contacts.

The state value handed to the provider is random, single-use, valid ten minutes and kept only as a hash, and the request uses PKCE.

Limits

Starting a provider sign-in and exchanging a code count toward the project's sign-in attempts per network address. See Authentication settings.

More providers are being built. See More sign-in methods.

This page as Markdown · llms.txt · Rezin Core is in development and available by invitation.