Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(auth): render JumpCloud sign-in button (#16888)

Steffen Schmitzb1f5270764b7
diff --git a/web/src/__tests__/auth-sign-in-page.clienttest.tsx b/web/src/__tests__/auth-sign-in-page.clienttest.tsx
index b2cf5d29b9..59d80bac4a 100644
--- a/web/src/__tests__/auth-sign-in-page.clienttest.tsx
+++ b/web/src/__tests__/auth-sign-in-page.clienttest.tsx
@@ -67,6 +67,7 @@ const authProviders: PageProps["authProviders"] = {
auth0: false,
clickhouseCloud: false,
cognito: false,
+ jumpcloud: false,
keycloak: false,
workos: false,
wordpress: false,
@@ -221,3 +222,49 @@ describe("sign-in page NextAuth error classification", () => {
expect(captureExceptionMock).not.toHaveBeenCalled();
});
});
+
+describe("sign-in page JumpCloud provider button", () => {
+ beforeEach(() => {
+ signInMock.mockReset();
+ signInMock.mockResolvedValue(undefined);
+ routerState.query = {};
+ window.localStorage.clear();
+ });
+
+ it("does not render a JumpCloud button when the provider is disabled", () => {
+ renderSignIn();
+
+ expect(
+ screen.queryByRole("button", { name: /JumpCloud/ }),
+ ).not.toBeInTheDocument();
+ });
+
+ it("renders a JumpCloud button and signs in with the jumpcloud provider", () => {
+ renderSignIn({
+ authProviders: {
+ ...authProviders,
+ jumpcloud: true,
+ },
+ });
+
+ const button = screen.getByRole("button", { name: /JumpCloud/ });
+ fireEvent.click(button);
+
+ expect(signInMock).toHaveBeenCalledWith("jumpcloud");
+ });
+
+ it("still renders JumpCloud when username/password auth is disabled", () => {
+ renderSignIn({
+ authProviders: {
+ ...authProviders,
+ credentials: false,
+ jumpcloud: true,
+ },
+ });
+
+ expect(
+ screen.getByRole("button", { name: /JumpCloud/ }),
+ ).toBeInTheDocument();
+ expect(screen.queryByLabelText("Email")).not.toBeInTheDocument();
+ });
+});
diff --git a/web/src/pages/auth/enterprise-sso-required.tsx b/web/src/pages/auth/enterprise-sso-required.tsx
index 1dfbeebdf7..e286b5493f 100644
--- a/web/src/pages/auth/enterprise-sso-required.tsx
+++ b/web/src/pages/auth/enterprise-sso-required.tsx
@@ -36,6 +36,7 @@ const PROVIDER_LABELS: Record<string, string> = {
auth0: "Auth0",
cognito: "Cognito",
keycloak: "Keycloak",
+ jumpcloud: "JumpCloud",
workos: "WorkOS",
wordpress: "WordPress",
custom: "Custom OAuth",
diff --git a/web/src/pages/auth/sign-in.tsx b/web/src/pages/auth/sign-in.tsx
index e839badf4f..baa48f8496 100644
--- a/web/src/pages/auth/sign-in.tsx
+++ b/web/src/pages/auth/sign-in.tsx
@@ -81,6 +81,7 @@ export type PageProps = {
auth0: boolean;
clickhouseCloud: boolean;
cognito: boolean;
+ jumpcloud: boolean;
keycloak:
| {
name: string;
@@ -158,6 +159,10 @@ export const getServerSideProps: GetServerSideProps<PageProps> = async () => {
env.AUTH_COGNITO_CLIENT_ID !== undefined &&
env.AUTH_COGNITO_CLIENT_SECRET !== undefined &&
env.AUTH_COGNITO_ISSUER !== undefined,
+ jumpcloud:
+ env.AUTH_JUMPCLOUD_CLIENT_ID !== undefined &&
+ env.AUTH_JUMPCLOUD_CLIENT_SECRET !== undefined &&
+ env.AUTH_JUMPCLOUD_ISSUER !== undefined,
keycloak:
env.AUTH_KEYCLOAK_CLIENT_ID !== undefined &&
env.AUTH_KEYCLOAK_CLIENT_SECRET !== undefined &&
@@ -214,6 +219,7 @@ export const FALLBACK_AUTH_PROVIDERS: PageProps["authProviders"] = {
auth0: false,
clickhouseCloud: false,
cognito: false,
+ jumpcloud: false,
keycloak: false,
workos: false,
wordpress: false,
@@ -402,6 +408,17 @@ export function SSOButtons({
}
/>
)}
+ {authProviders.jumpcloud && (
+ <AuthProviderButton
+ icon={<TbBrandOauth className="mr-3" size={18} />}
+ label="JumpCloud"
+ onClick={() => handleSignIn("jumpcloud")}
+ loading={providerSigningIn === "jumpcloud"}
+ showLastUsedBadge={
+ hasMultipleAuthMethods && lastUsedMethod === "jumpcloud"
+ }
+ />
+ )}
{authProviders.keycloak && (
<AuthProviderButton
icon={<SiKeycloak className="mr-3" size={18} />}