Skip to main content
If Lobyco holds your membership data and Lobyco IDP signs your customers in, your own websites can use the same sign-in. A corporate site or a web shop then shares sign-up, sign-in and the MyProfile page with the app. It calls the Lobyco APIs on the customer’s behalf. This page is the flow your website implements. Your web developers do it, with a standard OAuth 2.0 library. Lobyco IDP supports the OAuth 2.0 authorization code flow with PKCE. A public client, such as a single-page application, uses it without a client secret.
Use a standard OAuth 2.0 or OpenID Connect client library for your front-end framework rather than the raw protocol. Lobyco recommends it because the library handles PKCE, the redirects, token storage and silent renewal for you.

Before you start

Ask Lobyco to register the website as a public OAuth client in Lobyco IDP. Lobyco needs:
  • The client name, that is your application’s name.
  • The redirect URIs: the exact URLs customers return to after signing in, such as https://example.com/callback.
You receive two values, IDENTITY_BASE_URL and CLIENT_ID.

The flow

1

Send the customer to the authorization endpoint

The customer signs in, or signs up, and authorises your application. Lobyco IDP sends the browser back to your redirect_uri with an authorization code. The scopes to ask for are under Scopes.
2

Exchange the code for tokens

The response carries:
  • access_token, for calling the Lobyco APIs.
  • id_token, the customer’s identity, when OpenID Connect is enabled for the client.
  • refresh_token, for renewing the tokens, when the client is allowed one.
3

Call the APIs with the access token

Put the access token in the Authorization header of each request:

Scopes

Validate tokens on your backend

Which check your backend runs depends on the token type. A JWT access token is validated locally against the issuer’s jwks_uri. An opaque access token is checked by calling the introspection endpoint, /oauth2/introspect.

Failure and edge cases

The usual failure is a redirect URI mismatch. The redirect_uri must match exactly what Lobyco registered, including the scheme and the path. Otherwise Lobyco IDP refuses the request before the customer sees a sign-in page.
Last modified on October 19, 2026