End-User Authentication

Overview

End-user authentication allows your application to access b.well services on behalf of a specific user. Users authenticate through your existing Identity Provider, and b.well issues access tokens scoped to that user's context.

b.well uses OAuth 2.0 Token Exchange (RFC 8693) with OpenID Connect (OIDC) to enable Single Sign-On (SSO) across your applications while maintaining consistent user identity.

📘

How it Works

  1. User authenticates — User logs into your application through your Identity Provider (IdP)
  2. IdP returns ID token — Your IdP issues an OIDC-compliant ID token (JWT)
  3. Token exchange — Your application sends the ID token to b.well's OAuth token endpoint
  4. b.well validates token — b.well verifies the token signature and issuer against your registered IdP
  5. b.well issues access token — b.well returns a scoped access token for the authenticated user
  6. Access b.well services — Use the access token to authenticate requests to b.well's platform

Note: b.well SDKs and Embeddable UI handle this flow automatically, including token storage, refresh, and request authorization.

Prerequisites

Complete these requirements during onboarding with b.well.

Identity Provider Requirements

Your Identity Provider must support:

  • OpenID Connect (OIDC) — Industry-standard authentication protocol
  • JWT-based ID tokens — Signed with RS256 or stronger
  • OIDC Discovery — Publicly accessible .well-known/openid-configuration endpoint

Configuration

You provide to b.well:

ItemDescriptionExample
OIDC Discovery EndpointYour IdP's OpenID configuration URL (for each environment)https://auth.yourcompany.com/.well-known/openid-configuration
Issuer IdentifierThe iss claim value from your IdP's tokenshttps://auth.yourcompany.com
Unique IdentifierThe claim within your IdP’s tokens that is unique across each usersub

b.well provides to you:

ItemDescription
Client IDYour application's unique identifier for each environment (Sandbox/Production)

ID Token Requirements

Your IdP's ID tokens must include standard OIDC claims. b.well validates tokens using your IdP's published public keys (JWKS endpoint) and matches them to user records.

💡 Profile Completion
If required information isn't available in the ID token, some integrations may prompt users to complete their profile after authentication.


Implementation

b.well provides multiple integration paths for end-user authentication. Each method handles token exchange, storage, and refresh — you implement authentication methods in your application code.

Example: OAuth Token Exchange

Choose your end-user application integration path and follow its workflow guide for implementation details and code examples.

  • Embeddable
  • Health SDK for Web
  • Health SDK for Android
  • Health SDK for iPhone (coming soon)
  • Health SDK for AI
  • Application APIs

OAuth 2.0 Token Exchange is typically the preferred authentication pattern, allowing you to maintain consistent identity management within your application. If you prefer to use b.well as your Identity Provider or need custom authentication patterns, contact the b.well team to discuss options.