Skip to content

Sign-in methods: password, magic link, QR code and social logins

Describes PhoenixKit 3.5.0.

Settings > Authorization decides how people sign in: by password, by a link sent by email, by scanning a code with a phone that is already signed in, or with Google, GitHub or Facebook. It also styles the log-in page.

Where to find it

In the admin sidebar, Settings > Authorization (/admin/settings/authorization). You need the Security settings permission (part of Settings). The page has three tabs, Login Page Branding, Authentication Methods and Sessions, and one Save Authorization Settings button for all of them.

Login Page Branding

  • Background Image (Desktop) and Background Image (Mobile): Select Image picks one from the media library; Change image and Remove replace or clear it.
  • Background Color: a color or a CSS gradient, for example #1a1a2e or a linear-gradient(...).

Authentication Methods

Settings, Authorization, Authentication Methods in PhoenixKit: magic link for login and registration, QR code sign-in, login notifications, OAuth providers and the email confirmation requirement Settings, Authorization, Authentication Methods in PhoenixKit: magic link for login and registration, QR code sign-in, login notifications, OAuth providers and the email confirmation requirement

The sign-in methods a site offers.

Magic Link

  • Enable Magic Link for login: the log-in page offers Sign in with Magic Link. The person types their email and gets a link that expires in 15 minutes.
  • Enable Magic Link for registration: sign-up without a password. It can’t be ticked while registration is off ((registration disabled)).

QR Code

Enable QR code sign-in (scan from a signed-in phone): the log-in page offers Sign in with QR code. It shows a code; the person scans it with their phone’s camera on a phone that is already signed in, and taps Approve there.

Login Notifications

  • Email users when their account is signed in from a new device.
  • Email users when failed sign-ins on their account cross a threshold, with Failures in one hour that trigger the email (10 unless you change it). At most one such email goes out per account per 24 hours.

OAuth Providers

  • Enable OAuth (Master Switch): nothing below works while it is off.
  • Google Sign-In, GitHub Sign-In, Facebook Sign-In: one switch per provider.
  • Require the provider to confirm the email address: on by default. While on, signing in with a provider can only join an existing account if the provider says it verified that address. Turning it off lets anyone who gets an address onto a provider account sign in as its owner.

When a provider is switched on, its credentials card appears: Client ID and Client Secret for Google and GitHub, App ID and App Secret for Facebook. Leave a secret blank to keep the one already stored. Each card shows the Callback URL to copy into the provider’s console, with step-by-step setup instructions, and Test Credentials checks them.

The page’s own OAuth Setup Instructions sum it up: enable the provider and save, enter the credentials in the form that appears, save again, then click Test Credentials. Reload OAuth Configuration reloads the stored credentials.

Sessions

  • Enable multiple sessions: any signed-in user can add other accounts (with their password) and switch between them from the user menu.
  • Record failed sign-ins: stores failed password sign-ins, grouped by identifier, network and hour. They are shown on the person’s own settings page and on the admin Sessions page. Keep records for (days) sets how long (90 unless you change it).

What visitors see

The log-in page (/users/log-in) always has Email or Username and Password, Forgot your password? and Log in, plus Keep me logged in when persistent sessions are allowed (Settings > Users). Below, Or continue with lists the other methods that are on. Create an account shows only while registration is open.

The PhoenixKit sign-in page for the site Nordwind: email or username, password, Keep me logged in, Forgot your password, Log in, Create an account, and Sign in with Magic Link The PhoenixKit sign-in page for the site Nordwind: email or username, password, Keep me logged in, Forgot your password, Log in, Create an account, and Sign in with Magic Link

What visitors see: the sign-in page with the methods that are turned on.

What it doesn’t do

  • There is no switch to turn off password sign-in.
  • Social logins need the matching sign-in libraries installed in the app; the page notes that OAuth providers require ueberauth dependencies.
  • Who may register at all is set in Settings > Users, not here.