Users and access

A person has one My Auths account for every application that uses My Auths. They sign up once and can then sign in to any of those applications with the same email, password, Google or GitHub account.

Each application keeps its own members: the people who use that application, with their roles in it and whether they're active. You manage them in the dashboard, on the application's Sign-in, Roles and Members tabs.

Who can sign in

The Signup policy, on the Sign-in tab, decides who can use your application:

PolicyWho gets in
Open (default)Anyone with a My Auths account. The first time someone signs in to your application, they become a member with your default roles. People without an account can create one from the sign-in page.
Invite onlyOnly the people you added on the Members tab. Anyone else is sent back to your app with error=access_denied.

To add a member, enter the email of their My Auths account and pick their roles. They need an account first: if nobody has signed up with that email, the dashboard tells you so. Invitations for people without an account aren't available yet.

Roles

Roles are defined per application on the Roles tab, with names that make sense for your app, such as admin, editor or viewer. They reach your app in the access token's roles claim:

{ "sub": "b7c9e0a4-...", "roles": ["editor"] }
  • Roles marked default are given to people who join an Open application by signing in, and to members you add without choosing roles.
  • You can change a member's roles at any time. Tokens already issued keep the old roles until they expire, so the change reaches your app within 5 minutes, when it next refreshes.
  • Deleting a role removes it from every member.

Your API decides what each role may do. My Auths only tells it which roles the user has.

The user ID

The sub claim is the ID to store for a user. It's stable: it doesn't change when the user changes their name, signs in a different way, or resets their password. Don't use the email as the key for a user.

The ID is per company:

  • All the applications of one company receive the same sub for a person, so they can share data about that user.
  • Applications of different companies receive unrelated IDs for the same person, so they can't match their users against each other.

The Members tab shows the sub each member has in your application.

Suspending and removing members

On the Members tab you can suspend a member, reactivate them, or remove them.

  • A suspended member can't sign in to your application (access_denied), and their refresh tokens stop working (invalid_grant). An access token they already have stays valid until it expires, at most 5 minutes.
  • Removing a member deletes their membership and roles. In an Open application they can sign in again and rejoin with the default roles. To keep someone out of an Open application, suspend them instead of removing them.
  • A removed member who comes back gets a new sub unless they're still a member of another application of the same company. Keep that in mind before removing someone whose data you want to keep linked.

Email verification

With the email scope, tokens include email and email_verified:

  • Accounts that sign in with Google or GitHub are verified.
  • Accounts created with an email and password are verified once the user opens the link My Auths emails them when they sign up (or a password-reset link).

Unverified users can still sign in. Your application decides what to do with them, for example limit what they can do until email_verified is true.

Letting users change their password

Your application never sees or changes passwords. To let a user change theirs, link to the My Auths page for it, for example from your app's settings:

https://www.myauths.com/change-password?client_id=YOUR_CLIENT_ID&return_to=https%3A%2F%2Fapp.example.com%2Fsettings&login_hint=ada%40example.com
  • client_id: your application's client ID, so the page names your app.
  • return_to (optional): where the "Back to" link goes afterwards. It must be exactly one of your application's redirect URIs or post-logout redirect URIs, or the page shows no link back.
  • login_hint (optional): the user's email, filled in for them.

The user enters their email, current password and new password, plus a code if they use two-step verification. Changing the password signs them out everywhere, your application included: its refresh token stops working, so send the user through sign-in again when they come back. Users who sign in with Google or GitHub have no password to change; the page links them to Forgot password?, which adds one.

What My Auths handles for you

  • Password rules: at least 8 characters.
  • Locking: 5 wrong passwords in a row lock password sign-in for that email for 15 minutes.
  • Two-step verification: users who turned it on enter a code from an authenticator app, or a recovery code, after their password or after Google or GitHub. It applies to every application they sign in to; your app needs no changes.
  • Password reset: users reset their password from the sign-in page. A reset signs them out everywhere: the refresh tokens of every application stop working, and they sign in again with the new password.