in your `/etc/hosts` config.
2. Configure auth to serve HTTPS traffic over localhost by replacing `ListenAndServe` in [api.go](internal/api/api.go) with:
func (a *API) ListenAndServe(hostAndPort string) {
log := logrus.WithField("component", "api")
path, err := os.Getwd()
if err != nil {
log.Println(err)
}
server := &http.Server{
Addr: hostAndPort,
Handler: a.handler,
}
done := make(chan struct{})
defer close(done)
go func() {
waitForTermination(log, done)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
server.Shutdown(ctx)
}()
if err := server.ListenAndServeTLS("PATH_TO_CRT_FILE", "PATH_TO_KEY_FILE"); err != http.ErrServerClosed {
log.WithError(err).Fatal("http server listen failed")
}
}
3. Generate the crt and key file. See [here](https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/) for more information.
4. Generate the `GOTRUE_EXTERNAL_APPLE_SECRET` by following this [post](https://medium.com/identity-beyond-borders/how-to-configure-sign-in-with-apple-77c61e336003)!
### Email
Sending email is not required, but highly recommended for password recovery.
If enabled, you must provide the required values below.
GOTRUE_SMTP_HOST=smtp.mandrillapp.com
GOTRUE_SMTP_PORT=587
GOTRUE_SMTP_USER=smtp-delivery@example.com
GOTRUE_SMTP_PASS=correcthorsebatterystaple
GOTRUE_SMTP_ADMIN_EMAIL=support@example.com
GOTRUE_MAILER_SUBJECTS_CONFIRMATION="Please confirm"
`SMTP_ADMIN_EMAIL` - `string` **required**
The `From` email address for all emails sent.
`SMTP_HOST` - `string` **required**
The mail server hostname to send emails through.
`SMTP_PORT` - `number` **required**
The port number to connect to the mail server on.
`SMTP_USER` - `string`
If the mail server requires authentication, the username to use.
`SMTP_PASS` - `string`
If the mail server requires authentication, the password to use.
`SMTP_MAX_FREQUENCY` - `number`
Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. The value is the number of seconds. Defaults to 900 (15 minutes).
`SMTP_SENDER_NAME` - `string`
Sets the name of the sender. Defaults to the `SMTP_ADMIN_EMAIL` if not used.
`MAILER_AUTOCONFIRM` - `bool`
If you do not require email confirmation, you may set this to `true`. Defaults to `false`.
`MAILER_OTP_EXP` - `number`
Controls the duration an email link or OTP is valid for.
`MAILER_URLPATHS_INVITE` - `string`
URL path to use in the user invite email. Defaults to `/verify`.
`MAILER_URLPATHS_CONFIRMATION` - `string`
URL path to use in the signup confirmation email. Defaults to `/verify`.
`MAILER_URLPATHS_RECOVERY` - `string`
URL path to use in the password reset email. Defaults to `/verify`.
`MAILER_URLPATHS_EMAIL_CHANGE` - `string`
URL path to use in the email change confirmation email. Defaults to `/verify`.
`MAILER_SUBJECTS_INVITE` - `string`
Email subject to use for user invite. Defaults to `You've been invited`.
`MAILER_SUBJECTS_CONFIRMATION` - `string`
Email subject to use for signup confirmation. Defaults to `Confirm your email address`.
`MAILER_SUBJECTS_RECOVERY` - `string`
Email subject to use for password reset. Defaults to `Reset your password`.
`MAILER_SUBJECTS_MAGIC_LINK` - `string`
Email subject to use for magic link email. Defaults to `Your sign-in link`.
`MAILER_SUBJECTS_EMAIL_CHANGE` - `string`
Email subject to use for email change confirmation. Defaults to `Confirm your new email address`.
`MAILER_SUBJECTS_REAUTHENTICATION` - `string`
Email subject to use for reauthentication. Defaults to `{{ .Token }} is your verification code`.
`MAILER_SUBJECTS_PASSWORD_CHANGED_NOTIFICATION` - `string`
Email subject to use for password changed notification. Defaults to `Your password was changed`.
`MAILER_SUBJECTS_EMAIL_CHANGED_NOTIFICATION` - `string`
Email subject to use for email changed notification. Defaults to `Your email address was changed`.
`GOTRUE_MAILER_SUBJECTS_PHONE_CHANGED_NOTIFICATION` - `string`
Email subject to use for phone changed notification. Defaults to `Your phone number was changed`.
`GOTRUE_MAILER_SUBJECTS_IDENTITY_LINKED_NOTIFICATION` - `string`
Email subject to use for identity linked notification. Defaults to `A new sign-in method was linked to your account`.
`GOTRUE_MAILER_SUBJECTS_IDENTITY_UNLINKED_NOTIFICATION` - `string`
Email subject to use for identity unlinked notification. Defaults to `A sign-in method was removed from your account`.
`GOTRUE_MAILER_SUBJECTS_MFA_FACTOR_ENROLLED_NOTIFICATION` - `string`
Email subject to use for verification method added notification. Defaults to `A new verification method was added to your account`.
`GOTRUE_MAILER_SUBJECTS_MFA_FACTOR_UNENROLLED_NOTIFICATION` - `string`
Email subject to use for verification method removed notification. Defaults to `A verification method was removed from your account`.
`MAILER_TEMPLATES_INVITE` - `string`
URL path to an email template to use when inviting a user. (e.g. `https://www.example.com/path-to-email-template.html`)
`SiteURL`, `Email`, and `ConfirmationURL` variables are available.
Default Content (if template is unavailable):
You've been invited
You've been invited to create an account. Follow the link below to accept.
Accept invitation
`MAILER_TEMPLATES_CONFIRMATION` - `string`
URL path to an email template to use when confirming a signup. (e.g. `https://www.example.com/path-to-email-template.html`)
`SiteURL`, `Email`, and `ConfirmationURL` variables are available.
Default Content (if template is unavailable):
Confirm your email address
Follow the link below to confirm this email address and finish signing up.
Confirm email address
`MAILER_TEMPLATES_RECOVERY` - `string`
URL path to an email template to use when resetting a password. (e.g. `https://www.example.com/path-to-email-template.html`)
`SiteURL`, `Email`, and `ConfirmationURL` variables are available.
Default Content (if template is unavailable):
Reset your password
We received a request to reset your password. Follow the link below to choose a new one.
Reset password
If you didn't request this, you can safely ignore this email.
`MAILER_TEMPLATES_MAGIC_LINK` - `string`
URL path to an email template to use when sending magic link. (e.g. `https://www.example.com/path-to-email-template.html`)
`SiteURL`, `Email`, and `ConfirmationURL` variables are available.
Default Content (if template is unavailable):
Your sign-in link
Follow the link below to sign in. This link expires shortly and can only be used once.
Sign in
`MAILER_TEMPLATES_EMAIL_CHANGE` - `string`
URL path to an email template to use when confirming the change of an email address. (e.g. `https://www.example.com/path-to-email-template.html`)
`SiteURL`, `Email`, `NewEmail`, and `ConfirmationURL` variables are available.
Default Content (if template is unavailable):
Confirm your new email address
Follow the link below to confirm {{ .NewEmail }} as your new email address.
Confirm new email address
If you didn't request this change, you can safely ignore this email.
`MAILER_TEMPLATES_REAUTHENTICATION` - `string`
URL path to an email template to use when reauthenticating a user. (e.g. `https://www.example.com/path-to-email-template.html`)
`Token` variable is available.
Default Content (if template is unavailable):
Your verification code
Use the code below to verify your identity. It expires shortly.
{{ .Token }}
`MAILER_TEMPLATES_PASSWORD_CHANGED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that their password has been changed. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email` variables are available.
Default Content (if template is unavailable):
Your password was changed
The password for your account was recently changed.
If you didn't make this change, reset your password and contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_PASSWORD_CHANGED_ENABLED` - `bool`
Whether to send a notification email when a user's password is changed. Defaults to `false`.
`MAILER_TEMPLATES_EMAIL_CHANGED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that their email has been changed. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email` and `OldEmail` variables are available.
Default Content (if template is unavailable):
Your email address was changed
The email address for your account was changed from {{ .OldEmail }} to {{ .Email }}.
If you didn't make this change, contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_EMAIL_CHANGED_ENABLED` - `bool`
Whether to send a notification email when a user's email is changed. Defaults to `false`.
`GOTRUE_MAILER_TEMPLATES_PHONE_CHANGED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that their phone number has been changed. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email`, `Phone`, and `OldPhone` variables are available.
Default Content (if template is unavailable):
Your phone number was changed
The phone number for your account was changed from {{ .OldPhone }} to {{ .Phone }}.
If you didn't make this change, contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_PHONE_CHANGED_ENABLED` - `bool`
Whether to send a notification email when a user's phone number is changed. Defaults to `false`.
`GOTRUE_MAILER_TEMPLATES_IDENTITY_LINKED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that a sign-in method has been linked to their account. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email` and `Provider` variables are available.
Default Content (if template is unavailable):
A new sign-in method was linked
Your {{ .Provider }} account was linked as a new sign-in method for {{ .Email }}.
If you didn't make this change, contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_IDENTITY_LINKED_ENABLED` - `bool`
Whether to send a notification email when a sign-in method is linked to a user's account. Defaults to `false`.
`GOTRUE_MAILER_TEMPLATES_IDENTITY_UNLINKED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that a sign-in method has been removed from their account. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email` and `Provider` variables are available.
Default Content (if template is unavailable):
A sign-in method was removed
Your {{ .Provider }} account was removed as a sign-in method for {{ .Email }}.
If you didn't make this change, contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_IDENTITY_UNLINKED_ENABLED` - `bool`
Whether to send a notification email when a sign-in method is removed from a user's account. Defaults to `false`.
`GOTRUE_MAILER_TEMPLATES_MFA_FACTOR_ENROLLED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that a new verification method has been added to their account. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email` and `FactorType` variables are available.
Default Content (if template is unavailable):
A new verification method was added
Sign-in verification method {{ .FactorType }} was added to your account.
If you didn't make this change, contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_MFA_FACTOR_ENROLLED_ENABLED` - `bool`
Whether to send a notification email when a new verification method is added to a user's account. Defaults to `false`.
`GOTRUE_MAILER_TEMPLATES_MFA_FACTOR_UNENROLLED_NOTIFICATION` - `string`
URL path to an email template to use when notifying a user that a verification method has been removed from their account. (e.g. `https://www.example.com/path-to-email-template.html`)
`Email` and `FactorType` variables are available.
Default Content (if template is unavailable):
A verification method was removed
Sign-in verification method {{ .FactorType }} was removed from your account.
If you didn't make this change, contact support immediately.
`GOTRUE_MAILER_NOTIFICATIONS_MFA_FACTOR_UNENROLLED_ENABLED` - `bool`
Whether to send a notification email when a verification method is removed from a user's account. Defaults to `false`.
### Phone Auth
`SMS_AUTOCONFIRM` - `bool`
If you do not require phone confirmation, you may set this to `true`. Defaults to `false`.
`SMS_MAX_FREQUENCY` - `number`
Controls the minimum amount of time that must pass before sending another SMS OTP. The value is the number of seconds. Defaults to 60 (1 minute).
`SMS_OTP_EXP` - `number`
Controls the duration an SMS OTP is valid for.
`SMS_OTP_LENGTH` - `number`
Controls the number of digits of the SMS OTP sent.
`SMS_PROVIDER` - `string`
Available options are: `twilio`, `messagebird`, `textlocal`, and `vonage`
Then you can use your [twilio credentials](https://www.twilio.com/docs/usage/requests-to-twilio#credentials):
- `SMS_TWILIO_ACCOUNT_SID`
- `SMS_TWILIO_AUTH_TOKEN`
- `SMS_TWILIO_MESSAGE_SERVICE_SID` - can be set to your twilio sender mobile number
Or Messagebird credentials, which can be obtained in the [Dashboard](https://dashboard.messagebird.com/en/developers/access):
- `SMS_MESSAGEBIRD_ACCESS_KEY` - your Messagebird access key
- `SMS_MESSAGEBIRD_ORIGINATOR` - SMS sender (your Messagebird phone number with + or company name)
### CAPTCHA
- If enabled, CAPTCHA will check the request body for the `captcha_token` field and make a verification request to the CAPTCHA provider.
`SECURITY_CAPTCHA_ENABLED` - `string`
Whether captcha middleware is enabled
`SECURITY_CAPTCHA_PROVIDER` - `string`
for now the only options supported are: hCaptcha and Turnstile
- `SECURITY_CAPTCHA_SECRET` - `string`
- `SECURITY_CAPTCHA_TIMEOUT` - `string`
Retrieve from hcaptcha or turnstile account
### Reauthentication
`SECURITY_UPDATE_PASSWORD_REQUIRE_REAUTHENTICATION` - `bool`
Enforce reauthentication on password update.
### Anonymous Sign-Ins
`GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED` - `bool`
Use this to enable/disable anonymous sign-ins.
### IP address forwarding
`GOTRUE_SECURITY_SB_FORWARDED_FOR_ENABLED` - `bool`
Enable IP address forwarding using the `Sb-Forwarded-For` HTTP request header. When enabled, Auth will parse the first value of this header as an IP address and use it for IP address tracking and rate limiting. Make sure this header is fully trusted before enabling this feature by only passing it from trustworthy clients or proxies.
## Endpoints
Auth exposes the following endpoints:
### **GET /settings**
Returns the publicly available settings for this auth instance.
{
"external": {
"apple": true,
"azure": true,
"bitbucket": true,
"discord": true,
"facebook": true,
"figma": true,
"github": true,
"gitlab": true,
"google": true,
"keycloak": true,
"linkedin": true,
"notion": true,
"slack": true,
"snapchat": true,
"spotify": true,
"twitch": true,
"twitter": true,
"workos": true
},
"disable_signup": false,
"autoconfirm": false
}
### **POST, PUT /admin/users/**
Creates (POST) or Updates (PUT) the user based on the `user_id` specified. The `ban_duration` field accepts the following time units: "ns", "us", "ms", "s", "m", "h". See [`time.ParseDuration`](https://pkg.go.dev/time#ParseDuration) for more details on the format used.
headers:
{
"Authorization": "Bearer eyJhbGciOiJI...M3A90LCkxxtX9oNP9KZO" // requires a role claim that can be set in the GOTRUE_JWT_ADMIN_ROLES env var
}
body:
{
"role": "test-user",
"email": "email@example.com",
"phone": "12345678",
"password": "secret", // only if type = signup
"email_confirm": true,
"phone_confirm": true,
"user_metadata": {},
"app_metadata": {},
"ban_duration": "24h" or "none" // to unban a user
}
### **POST /admin/generate_link**
Returns the corresponding email action link based on the type specified. Among other things, the response also contains the query params of the action link as separate JSON fields for convenience (along with the email OTP from which the corresponding token is generated).
headers:
{
"Authorization": "Bearer eyJhbGciOiJI...M3A90LCkxxtX9oNP9KZO" // admin role required
}
body:
{
"type": "signup" or "magiclink" or "recovery" or "invite" or "email_change_current" or "email_change_new",
"email": "email@example.com",
"password": "secret", // only if type = signup
"data": {
...
}, // only if type = signup
"redirect_to": "https://supabase.io" // Redirect URL to send the user to after an email action. Defaults to SITE_URL.
}
Returns
{
"action_link": "http://localhost:9999/verify?token=TOKEN&type=TYPE&redirect_to=REDIRECT_URL",
"email_otp": "EMAIL_OTP",
"hashed_token": "TOKEN",
"verification_type": "TYPE",
"redirect_to": "REDIRECT_URL",
...
}
### **POST /signup**
Register a new user with an email and password.
{
"email": "email@example.com",
"password": "secret"
}
returns:
{
"id": "11111111-2222-3333-4444-5555555555555",
"email": "email@example.com",
"confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
"created_at": "2016-05-15T19:53:12.368652374-07:00",
"updated_at": "2016-05-15T19:53:12.368652374-07:00"
}
// if sign up is a duplicate then faux data will be returned
// as to not leak information about whether a given email
// has an account with your service or not
Register a new user with a phone number and password.
{
"phone": "12345678", // follows the E.164 format
"password": "secret"
}
Returns:
{
"id": "11111111-2222-3333-4444-5555555555555", // if duplicate sign up, this ID will be faux
"phone": "12345678",
"confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
"created_at": "2016-05-15T19:53:12.368652374-07:00",
"updated_at": "2016-05-15T19:53:12.368652374-07:00"
}
if AUTOCONFIRM is enabled and the sign up is a duplicate, then the endpoint will return:
{
"code": 400,
"msg": "User already registered"
}
### **POST /resend**
Allows a user to resend an existing signup, sms, email_change or phone_change OTP.
{
"email": "user@example.com",
"type": "signup"
}
{
"phone": "12345678",
"type": "sms"
}
returns:
{
"message_id": "msgid123456"
}
### **POST /invite**
Invites a new user with an email.
This endpoint requires the `service_role` or `supabase_admin` JWT set as an Auth Bearer header:
e.g.
headers: {
"Authorization" : "Bearer eyJhbGciOiJI...M3A90LCkxxtX9oNP9KZO"
}
{
"email": "email@example.com"
}
Returns:
{
"id": "11111111-2222-3333-4444-5555555555555",
"email": "email@example.com",
"confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
"created_at": "2016-05-15T19:53:12.368652374-07:00",
"updated_at": "2016-05-15T19:53:12.368652374-07:00",
"invited_at": "2016-05-15T19:53:12.368652374-07:00"
}
### **POST /verify**
Verify a registration or a password recovery. Type can be `signup`, `recovery`, `invite`, `magiclink`, `email_change`, `sms`, or `phone_change`
and the `token` is a token returned from either `/signup` or `/recover`.
{
"type": "signup",
"token": "confirmation-code-delivered-in-email"
}
`password` is required for signup verification if no existing password exists.
Returns:
{
"access_token": "jwt-token-representing-the-user",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "a-refresh-token",
"type": "signup | recovery | invite | magiclink | email_change | sms | phone_change"
}
Verify a phone signup or SMS OTP. Type should be set to `sms`.
{
"type": "sms",
"token": "confirmation-otp-delivered-in-sms",
"redirect_to": "https://supabase.io",
"phone": "phone-number-sms-otp-was-delivered-to"
}
Returns:
{
"access_token": "jwt-token-representing-the-user",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "a-refresh-token"
}
### **GET /verify**
Verify a registration or a password recovery. Type can be `signup`, `recovery`, `magiclink`, `invite`, or `email_change`
and the `token` is a token returned from either `/signup` or `/recover` or `/magiclink`.
query params:
{
"type": "signup",
"token": "confirmation-code-delivered-in-email",
"redirect_to": "https://supabase.io"
}
User will be logged in and redirected to:
SITE_URL/#access_token=jwt-token-representing-the-user&token_type=bearer&expires_in=3600&refresh_token=a-refresh-token&type=invite
Your app should detect the query params in the fragment and use them to set the session (supabase-js does this automatically)
You can use the `type` param to redirect the user to a password set form in the case of `invite` or `recovery`,
or show an account confirmed/welcome message in the case of `signup`, or direct them to some additional onboarding flow
### **POST /otp**
One-Time-Password. Will deliver a magic link or SMS OTP to the user depending on whether the request body contains an "email" or "phone" key.
If `"create_user": true`, user will not be automatically signed up if the user doesn't exist.
{
"phone": "12345678" // follows the E.164 format
"create_user": true
}
OR
// exactly the same as /magiclink
{
"email": "email@example.com"
"create_user": true
}
Returns:
{}
### **POST /magiclink** (recommended to use /otp instead. See above.)
Magic Link. Will deliver a link (e.g. `/verify?type=magiclink&token=fgtyuf68ddqdaDd`) to the user based on
email address which they can use to redeem an access_token.
By default Magic Links can only be sent once every 60 seconds
{
"email": "email@example.com"
}
Returns:
{}
When the magic link is clicked, it will redirect to `#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=magiclink` (see `/verify` above)
### **POST /recover**
Password recovery. Will deliver a password recovery mail to the user based on
email address.
By default recovery links can only be sent once every 60 seconds
{
"email": "email@example.com"
}
Returns:
{}
### **POST /token**
This is an OAuth2 endpoint that currently implements
the password and refresh_token grant types
query params:
?grant_type=password
body:
// Email login
{
"email": "name@domain.com",
"password": "somepassword"
}
// Phone login
{
"phone": "12345678",
"password": "somepassword"
}
or
query params:
grant_type=refresh_token
body:
{
"refresh_token": "a-refresh-token"
}
Once you have an access token, you can access the methods requiring authentication
by settings the `Authorization: Bearer YOUR_ACCESS_TOKEN_HERE` header.
Returns:
{
"access_token": "jwt-token-representing-the-user",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "a-refresh-token"
}
### **GET /user**
Get the JSON object for the logged in user (requires authentication)
Returns:
{
"id": "11111111-2222-3333-4444-5555555555555",
"email": "email@example.com",
"confirmation_sent_at": "2016-05-15T20:49:40.882805774-07:00",
"created_at": "2016-05-15T19:53:12.368652374-07:00",
"updated_at": "2016-05-15T19:53:12.368652374-07:00"
}
### **PUT /user**
Update a user (Requires authentication). Apart from changing email/password, this
method can be used to set custom user data. Changing the email will result in a magic link being sent out.
{
"email": "new-email@example.com",
"password": "new-password",
"phone": "+123456789",
"data": {
"key": "value",
"number": 10,
"admin": false
}
}
Returns:
{
"id": "11111111-2222-3333-4444-5555555555555",
"email": "email@example.com",
"email_change_sent_at": "2016-05-15T20:49:40.882805774-07:00",
"phone": "+123456789",
"phone_change_sent_at": "2016-05-15T20:49:40.882805774-07:00",
"created_at": "2016-05-15T19:53:12.368652374-07:00",
"updated_at": "2016-05-15T19:53:12.368652374-07:00"
}
If `GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_REAUTHENTICATION` is enabled, the user will need to reauthenticate first.
{
"password": "new-password",
"nonce": "123456"
}
### **GET /reauthenticate**
Sends a nonce to the user's email (preferred) or phone. This endpoint requires the user to be logged in / authenticated first. The user needs to have either an email or phone number for the nonce to be sent successfully.
headers: {
"Authorization" : "Bearer eyJhbGciOiJI...M3A90LCkxxtX9oNP9KZO"
}
### **POST /logout**
Logout a user (Requires authentication).
This will revoke all refresh tokens for the user. Remember that the JWT tokens
will still be valid for stateless auth until they expire.
### **GET /authorize**
Get access_token from external oauth provider
query params:
provider=apple | azure | bitbucket | discord | facebook | figma | github | gitlab | google | keycloak | linkedin | notion | slack | snapchat | spotify | twitch | twitter | workos
scopes=
Redirects to provider and then to `/callback`
For Apple-specific setup see:
### **GET /callback**
External provider should redirect to this endpoint
Redirects to `#access_token=&refresh_token=&provider_token=&expires_in=3600&provider=`
If additional scopes were requested then `provider_token` will be populated, you can use this to fetch additional data from the provider or interact with their services