HonkIO Auth

Organizations

On Business, users can belong to organizations, with one role each and invitations to join. Tokens carry the organization the user signed in to.

Organizations

Business plan. Users can belong to organizations, such as the companies using your B2B app. An organization has an ID (org_…), a name and a slug that’s unique within the app. Manage organizations in the dashboard, or with an API key that has the auth_organizations permission.

Roles

Each member has exactly one role per organization: admin, member, or a role name you define. Roles are names, not permission sets: your app decides what each role may do. A role, like an organization, can require two-step verification.

Invitations

Invite people by email or phone, optionally into an organization with a role. An invitation is single use, expires after 7 days and is tied to the invited email or phone: accepting it means signing in as that identifier. Revoke it any time before it’s accepted. Invitations are how people join an invite-only app.

Choosing the organization

Pass organization with an organization’s ID or slug in the authorize request to sign the user in to that organization:

authorize
https://login.acme.ca/authorize?client_id=hka_xxxxxxxxxxxx
  &response_type=code&scope=openid%20email
  &redirect_uri=https%3A%2F%2Fapp.acme.ca%2Fauth%2Fcallback
  &code_challenge=…&code_challenge_method=S256&state=…&nonce=…
  &organization=org_clxxxorgxxxxxxxxxxxxxxx

Without it, a user in more than one organization picks one after signing in, with the last one used highlighted. A user in exactly one organization skips the picker.

Organization claims

The ID and access tokens carry the organization the user signed in to: org_id, org_slug and org_role, as they were when the token was issued. Removing someone from an organization takes effect at their next refresh, within 10 minutes: the refresh fails with invalid_grant and your app ends the session. A membership.deleted webhook is sent immediately, so you can act sooner.

Who can sign up

On every plan, each app chooses who can sign up with sign_up_mode on its sign-in policy:

  • open (the default): anyone can sign up.
  • invite_only: only people with an invitation.
  • domains: only email addresses at the domains in sign_up_domains.

Existing users always sign in. Someone who isn’t allowed to sign up sees the same page as everyone else, and nothing is sent.