Setting up a connection
A connection is an organization’s link to its identity provider, over OpenID Connect or SAML. To set one up, open Settings > Authentication > Identity provider as an organization administrator and give:- the provider’s issuer, client id and client secret, or its SAML metadata
- the email domain the connection signs in
- a test sign-in through the provider
- an administrator who can still sign in if the provider is unavailable
ADMIN_EMAILS adds a domain
without proof. Other organization administrators complete the DNS or file
check.
Before you start
- Activate an Enterprise license. Single sign-on turns on without a restart once the license is active.
- Set
BASE_HOSTandNEXTAUTH_URLto the public HTTPS address people use to open LangWatch. The redirect URI the identity provider calls uses that address. - Keep
CREDENTIALS_SECRETstable across app and worker processes. It encrypts the stored client secrets, and a new value cannot decrypt the existing ones.
Redirect URI
Every connection has its own redirect URI, shown on the setup page:Issuer
Enter the issuer exactly as it appears in theiss claim of the provider’s
ID tokens. When you register the connection, LangWatch fetches
<issuer>/.well-known/openid-configuration and saves the issuer value from
that response, so a trailing slash you typed or left out is corrected. If the
response gives a different issuer, you get an error and the connection is not saved.
Check an issuer by fetching its discovery document:
Replace
YOUR_TENANT_ID with your tenant id, or set ISSUER to your provider’s issuer:
openid,
email and profile scopes. GitHub sign-in is OAuth without OpenID Connect,
so it cannot be a connection.
Behind a corporate proxy
If your installation reaches the internet only through an HTTP proxy, set the standardHTTPS_PROXY (or HTTP_PROXY) and NO_PROXY variables on the app and
the workers. When you register or edit a connection, LangWatch fetches the
discovery document through the proxy, and it fetches the domain verification
file through the proxy too. It still checks that the address is public first,
and checks every redirect again.
NO_PROXY only chooses a direct connection: it does not lift that check. An
identity provider inside your network needs its origin in
SSO_TRUSTED_IDP_ORIGINS. LangWatch then reads its discovery document
directly, never through the proxy, so that read needs no NO_PROXY entry. If
you also turn on Node’s environment proxy (below), add the identity provider’s
hosts to NO_PROXY so the rest of sign-in reaches them directly too.
The proxy looks up the hostname itself, so LangWatch cannot hold the connection
to the address it checked. Configure the proxy to refuse every address that is
not public: loopback (such as 127.0.0.1 and ::1), private and link-local
ranges, and cloud metadata addresses (such as 169.254.169.254).
Only these two requests use the proxy by default, and neither is part of
signing in. By default, every request made during sign-in goes direct, not
through HTTPS_PROXY:
- the discovery document, read again at every sign-in to learn which addresses
your identity provider signs people in from (such as
oauth2.googleapis.comfor Google) - the token exchange
- the signing keys
- the user info, when the provider has a user info endpoint
NODE_USE_ENV_PROXY=1 (or
--use-env-proxy in NODE_OPTIONS), Node sends these sign-in requests through
HTTPS_PROXY too (unless NO_PROXY names the host), and LangWatch reads the
sign-in discovery document through the proxy to match. Then the proxy must
allow your identity provider’s discovery, token, keys and user info endpoints,
unless NO_PROXY names their hosts.
Microsoft Entra ID
- Register LangWatch as an app in Entra ID and add the redirect URI under the Web platform.
- Use the issuer of the tenant that holds the app registration,
https://login.microsoftonline.com/<tenant id>/v2.0. You cannot register thecommon,organizationsorconsumersendpoints: an ID token from them has the user’s own tenant iniss. - LangWatch reads the address from the
emailclaim, so each user needs a mail address in Entra ID. In Token configuration, add the optionalemailandxms_edovclaims to the ID token.
Existing email and password accounts
On a self-hosted installation, a sign-in through a connection links to an existing email and password account with the same address once the connection has verified the address’s domain. This includes accounts whose address was never confirmed, which is every account on an installation without outbound email. The identity provider does not have to sendemail_verified. Microsoft Entra
ID never sends it, and SAML has no such attribute. A sign-in where the provider
reports the address as unverified, with email_verified: false or with Entra
ID’s xms_edov: false, is refused with “An account with this address already
exists”.
On LangWatch Cloud, a sign-in links to an existing account only when the
address is confirmed and the provider sends email_verified: true.