Skip to main content

Logging in with your own provider

Members log in through the identity provider of your organization, any that speaks OpenID Connect: Auth0, Okta, Keycloak, ZITADEL, Authentik and the like. For Google, Microsoft, Apple, Facebook and GitHub use their own rows instead, which know each of them.

Setting it up takes about ten minutes: a web application at your provider, its issuer, client ID and client secret in Poly Community, and a test. The steps below show Auth0, and the same three things come from any other provider.

You need:

  • An administrator account at your provider.
  • Your site on https.

How single sign-on works for every provider, and what each setting does, is on Single sign-on.

1. Copy the redirect address​

In WordPress, go to Poly Community → Settings → Services → Single sign-on and copy the Redirect address under the list of providers, such as https://example.com/wp-json/wordplus/v1/sso/back. Every provider sends members back there.

2. Make a web application at your provider​

At any provider, it is the same five things:

  1. Make an application for logging in to a website: a web application that runs on a server and keeps a client secret, with the authorization code flow.
  2. Enter the Redirect address as its sign-in redirect address, exactly as it is.
  3. Let it ask for the scopes openid, email and profile.
  4. Copy its client ID and client secret.
  5. Find the issuer of the provider: the address under which it publishes /.well-known/openid-configuration.
ProviderIssuer
Auth0https:// and the Domain of the application, such as https://your-tenant.us.auth0.com/
Oktahttps://your-org.okta.com/oauth2/default, or https://your-org.okta.com for the organization itself
Keycloakhttps://your-host/realms/your-realm
ZITADELhttps://your-instance.zitadel.cloud

The provider may ask how the client secret is sent. Either way works: Poly Community sends it in the body of the request, and when the provider refuses that, as HTTP Basic, and keeps the way that worked. Each login also carries PKCE, which the provider may ask for.

With Auth0​

  1. In the Auth0 dashboard, go to Applications → Applications and press Create Application.

  2. Name it after your site, choose Regular Web Application and press Create.

    Create application in Auth0: the name Riverside Community, Create Manually, and Regular Web Application chosen among the four application types
    Auth0 → Applications → Create Application
  3. On the URLs tab of the application, paste the Redirect address into Allowed Callback URLs, press Enter so it becomes an item of the list, and press Save at the bottom of the page. The other addresses there can stay empty.

    Allowed Callback URLs in Auth0 with the redirect address of the site as its one item
    The URLs tab of the application
  4. The Credentials tab says how the client secret is sent. Leave Client Secret (Post), the way Auth0 sets new applications. Client Secret (Basic) works too.

    Client Authentication Methods in Auth0 with Client Secret (Post) chosen, and the Client Secret hidden with Copy, Reveal and Rotate
    The Credentials tab of the application
  5. The Settings tab has the three things Poly Community needs: the Domain, the Client ID and the Client Secret. Copy each with the button at its end. The issuer is the Domain with https:// before it, such as https://riverside.us.auth0.com/.

    Basic Information in Auth0: the Name, the Domain, the Client ID and the Client Secret hidden, each with a copy button
    The Settings tab of the application

A new application can log in with the two connections Auth0 starts every account with: an email address and password kept at Auth0, and Google. Others, such as your company directory, are added under Authentication in the dashboard and turned on for the application on its Connections tab. Until the Google connection has keys of your own (Authentication → Social), Auth0 uses development keys of its own for it and logs a warning that they are only meant for testing.

3. Add the provider​

  1. Under the list of providers, press Add a provider.
  2. Fill in the dialog:
    • Name in small letters: a short name for the provider, such as auth0. It cannot be changed later.
    • Name on its button: what members read, such as Auth0 or the name of your organization. The button says Log in with and this name.
    • Issuer: the issuer from step 2, with or without the slash at its end.
    • Client ID and Client secret: from step 2.
    • The claim with groups: the name of the claim that lists the groups of a member, groups unless your provider calls it otherwise. See Larger teams: SCIM and groups.
  3. Decide who may use it with Let new people join with it and Only these domains can join. See Let new people join with it.
  4. Press Save the provider.
The Add a provider dialog filled for Auth0: Name in small letters auth0, Name on its button Auth0, the Issuer, Client ID, Client secret, The claim with groups, and Let new people join with it
Settings → Services → Single sign-on → Add a provider

Unlike the five named providers, a provider you add is on as soon as it is saved. Its row says Set up and On: its button is on the login forms, and Log in with and its name shows on the login form of the community and on the WordPress login screen. With Let new people join with it on, it shows on the sign-up forms too. To keep it from members until you are ready, switch it off under Settings → Joining → Logging in and press Save changes.

The login form of the community with Continue with Google and Log in with Auth0 under it
The login form, with Google and Auth0 on

4. Try it​

  1. In a private window, open the login page of your site and press Log in with and its name.

  2. Log in at your provider. Auth0 shows its own login page, which names your application.

    The Auth0 login page: Log in to riverside to continue to Riverside Community, email address and password, Continue, Sign up and Continue with Google
    The Auth0 login page
  3. You are back on your site:

    • A member whose account is connected is logged in.
    • Someone new, with Let new people join with it on, is on the sign-up form, which says Almost there. Fill in the rest to join with your Auth0 account. Their name and email address are filled in, the address marked From your Auth0 account., and they choose a username, as Auth0 sends none.
    • When an account here already has the email address, see An account that already has the address.

What the provider gives your site​

Poly Community reads the ID token of the login: the number of the account at the provider (sub), the email address and whether the provider confirmed it (email_verified), the name, the picture and the claim with groups. A provider may leave the email address and the name out of the ID token and give them only at its UserInfo address, as the specification allows: Poly Community then asks there with the login, and takes the answer only when it is about the same account.

A provider that names a username (preferred_username, as Okta and Keycloak do) has it filled in for someone new on the sign-up form, while no member here has it. When it is an email address, as Okta logins often are, only the part before the @ is filled in, so no address becomes a public name. They can change it there, and it is never used to find an account. Without one, as with Auth0, they choose a username themselves.

  • An email address the provider confirmed links an account here with that address, when its member confirmed it here too. See An account that already has the address.
  • One it did not confirm is confirmed with a code on the sign-up form.

At Auth0, an address that comes from Google is confirmed. One that someone typed when they signed up at Auth0 with a password stays unconfirmed until they confirm it at Auth0.

The provider has to sign its ID tokens with RS256, as most do by default, Auth0 among them.

When something goes wrong​

The provider says the callback or redirect address is not allowed​

The redirect address of the application is not exactly the one in WordPress. Auth0 says Callback URL mismatch. The provided redirect_uri is not in the list of allowed callback URLs. Paste the Redirect address again into the list of the application (at Auth0, Allowed Callback URLs on its URLs tab), and save. Check that nothing is added or left out: the same https, the same www or none, no slash at the end.

The login page says there is no account here for that account yet​

Let new people join with it is off for the provider, and no account here is connected to that account or has its confirmed email address. Someone who already has an account logs in to it another way and connects the provider in their account settings. To let new people join with it, turn the setting on in the dialog of the provider.

The login page says the provider could not be reached, or its settings do not match its issuer​

Poly Community could not read /.well-known/openid-configuration at the Issuer, or the issuer named there is not the one entered. Copy the issuer exactly as the provider names it in that document, with or without the slash at its end: Okta, for example, has an issuer for the organization and another for each authorization server.

The login page says the answer of the provider is not signed the way it should be​

The provider signs its ID tokens with another algorithm. Set it to RS256 in the settings of the application or the authorization server.

Someone new has to type their email address​

The provider gave no address: the email scope is missing from the application, or the account at the provider has none.

Anything else​

A Forbidden page from your host right after the provider, a login that always says it took too long, or a button that does not show: these happen with every provider and are on Common problems.