Clef button

Clef is a replacement for usernames and passwords that lets users log in to websites using just their phone, instead of remembering passwords. Using 2-factor authentication, Clef makes authentication secure and easy.

This module allows users to log into your Drupal site using Clef.

By default, a "Log in with your phone" button is added to existing login forms. If a user's computer is not logged in to Clef, clicking the button will show a QR code that users can scan with their phone in order to log into your site. (If they're using a phone to view your website, the button will open the Clef app instead.) If the user is logged in to Clef, clicking the button automatically authenticates them with the email address associated with the user's Clef account. If that email address is already in use then the user is logged in, and otherwise the user is registered if possible (or redirected to the registration form, depending on the module's settings).

The module also provides a block with the "Log in with your phone" button so you can place it wherever you'd like, or you can use the clef_login_button() function to place the button using code.


Before allowing users to log in with Clef, you must create a Clef application. To do that, visit the Clef developer site, sign in, and create a new application. You must give the app at least the "Email" permission, and the name-related permissions are recommended. Use your website's URL for the "Application domain." Clef will then give you an Application ID and Application Secret which you must copy-paste into the module's settings page at admin/people/clef.


This module is not built by Clef. Please ask Clef support for help with Clef itself and use the issue queue for problems with the module.

Project information