Connect Sign-in Codes
A sign-in code is a single-use key that signs a user in to Thirdlane Connect without typing a server address, user name or password. Users receive one as a QR code in their welcome email or create one in the User Portal. A user who is already signed in on a phone can also scan a code shown on a computer to sign that computer in.
Why you would want it
Every installed Connect app has to be told which server it belongs to, and the user then has to type their credentials on a phone keyboard; a mistyped server address stops the app from connecting (see Connect Provisioning). A sign-in code carries the server address and the account together, so the user scans and is signed in.
Signing in on a computer from a phone works the way messaging apps link a desktop client: the computer shows a QR code, the phone that is already signed in scans it, and the person approves the request on the phone. The password is never typed on the computer.
Sign-in with a user name and password, and through an identity provider, still work; sign-in codes are an additional way in.
How it works
Codes are single-use and short-lived
Each code works once. The first app that presents it is signed in and the code stops working. How long an unused code lasts depends on where it came from:
- Welcome email - 72 hours. Sending the welcome email again cancels the unused codes from the earlier email, so an old copy in someone’s mailbox stops working. Setting the first password from an invitation link does not cancel them, because the invitation asks the user to do exactly that and its QR code must still work afterwards.
- User Portal - 10 minutes. The user can create a new code or cancel the current one from the same window.
- Sign in with your phone - the code a computer shows lasts 2 minutes. A new one can be shown at any time.
The server stores only a fingerprint of each code (a SHA-256 hash), not the code itself, so a copy of the database cannot be used to sign in.
Opening a link does not use it up
Email security systems often open every link in a message to check it, so opening a link does not use the code. The link opens a page on your server that offers the next step (open the mobile app, open the desktop app, or continue in the browser), and the code is used only when an app actually signs in with it.
What a code-based sign-in produces
A sign-in with a code produces the same session as a password sign-in: the user stays signed in and the app renews its session the same way. The sign-in is recorded in Users and Access like any other, with its own authentication method.
A code cannot sign in to an account that is locked. An expired password does not block it, which matches sign-in through an identity provider.
The apps check the server before signing in
A sign-in link names the server it belongs to. When the server in a link is different from the one the app last used, the desktop and mobile apps ask the user to confirm the server name before signing in. An app built with a fixed server list that does not allow other addresses refuses links for servers that are not on its list.
Phone approval
When a user chooses Sign in with your phone on a computer:
- The computer shows a QR code that is valid for 2 minutes.
- The user scans it with the Connect mobile app, from Settings > Sign in on a computer. The phone must already be signed in, and to the same server.
- The phone shows the type of computer, its IP address and the account it will sign in as, and asks the user to Approve or Deny.
- After approval the computer is signed in as the same user as the phone.
A user should approve only a sign-in they started themselves. A request that nobody answers expires after 2 minutes.
How to set it up
Sign-in codes are on for every organization by default. To use them:
- Check the server address. Codes and links use the Service Address from Platform > General Settings & Tools > Preferences. Set it if users reach the server by a different name than its own host name, for example behind a proxy.
- Check the welcome email template. The default
welcome_userandinvite_usertemplates include a sign-in block with the QR code. A copy of either template edited before sign-in codes existed does not have the block; add it using the variables in Email Templates. - Send a welcome email to a test user and scan the QR code with the Connect mobile app (Scan QR code on its sign-in screen).
Turning it off for an organization
Open the organization in Platform > Accounts > Organizations, go to the Features and Limits tab and clear Connect QR sign-in. With it off:
- Welcome emails for that organization do not include a sign-in block.
- The User Portal does not show Set up mobile app or Open in desktop app.
- The server refuses to sign anyone in with a code, and refuses phone approvals from that organization’s users.
Users still sign in with their user name and password.
Operating it
- A user lost their code or it expired. Send the welcome email again from Organization > Users > User Extensions, or ask the user to open the User Portal and choose Set up mobile app.
- A user forwarded their welcome email. Send the welcome email again. That cancels the unused codes in the earlier email.
- The app says the code has been used or has expired. Each code works once. A code from the welcome email is also cancelled when the email is sent again.
- The app says QR sign-in is turned off. The user’s organization has Connect QR sign-in cleared.
- Repeated attempts are refused. The server limits how many codes can be created and tried from one IP address in a short time. Wait a few minutes and try again.
Best practices
- Keep the welcome email short-lived in practice. Ask users to scan the QR code when they receive the email rather than keeping it for later.
- Tell users to approve only sign-ins they started. The approval screen shows the computer type and IP address for this reason.
- Set the Service Address on any system behind a proxy or load balancer before sending welcome emails, so the links point to an address users can reach.
Related documentation
- Connect Provisioning - how users get each Connect app and how it finds the server
- Email Templates - the welcome and invite emails that carry the QR code
- User Portal Overview - where users create their own codes
- Signing In - the user’s side of signing in to Connect
- Organizations - the Connect QR sign-in setting
- Signed-in Devices - see and sign out the devices a code or password signed in