Skip to main content

Admin Portal

Empower your customers to configure and manage Single Sign-On settings independently

The Admin Portal simplifies the process of connecting your application to the identity or directory providers used by enterprise organizations. By offering a self-service portal, you can minimize the need for extensive back-and-forth communication between your team and your customers. Scalekit hosts and manages the Admin Portal entirely, providing two flexible integration options:

  1. No-Code Admin Portal: Generate a shareable link to the portal and distribute it to your customers through standard communication channels.
  2. Embedded Admin Portal: Integrate the Admin Portal seamlessly into your application using an iframe for a more unified user experience.

1. No-Code Admin Portal

To create and share a link for the Admin Portal, follow these steps:

  1. Log in to your Scalekit Dashboard.
  2. Navigate to the "Organizations" tab.
  3. Select the organization you want to provide access to.
  4. Click "Generate Link" to create a new, shareable Admin Portal link.
Integrate via Shareable Link

Important Considerations

  • The generated link is valid for 7 days but can be revoked at any time from the dashboard for security purposes.
  • You can share the link through communication channels such as email, Slack, or other preferred methods.
  • Be cautious when sharing the link, as anyone with access to it can view and update the organization's Single Sign-On settings.
Integrate via Shareable Link

2. Embedded Admin Portal

Embedding the Admin Portal into your application offers several benefits:

  • Easy Discoverability: IT admins can quickly locate and access the portal within your app.
  • Convenient Access: Enables seamless updates to Single Sign-On settings on the go.
  • Reduced Navigation Barriers: Eliminates the need for external links or separate portals.
Integrate via API

Install the Scalekit SDK, which includes the generatePortalLink() method:

Setup SDK
npm install @scalekit-sdk/node

Use the Generate Portal Link API to create a unique, embeddable Admin Portal link specific to an organization.

Generate Portal Link
import { Scalekit } from '@scalekit-sdk/node';

const scalekit = new Scalekit(
  process.env.ENVIRONMENT_URL,
  process.env.CLIENT_ID,
  process.env.CLIENT_SECRET,
);

async function generatePortalLink(orgID) {
  const link = await scalekit.organization.generatePortalLink(orgID);
  console.log(JSON.stringify(link, null, 2));
}

The API will return a JSON object containing the location property, which is the URL to the Admin Portal.

Generate Portal Link (Response Object)
{
  "id": "8930509d-68cf-4e2c-8c6d-94d2b5e2db43",
  "location": "https://random-subdomain.scalekit.dev/magicLink/8930509d-68cf-4e2c-8c6d-94d2b5e2db43",
  "expireTime": "2024-10-03T13:35:50.563013Z"
}

Access the location property and set it as the src attribute of an iframe in your web pages.

Embed Admin Portal in an Iframe
<body>
  <h1>Admin Portal (Embed)</h1>
  <iframe
    src="https://random-subdomain.scalekit.dev/magicLink/8930509d-68cf-4e2c-8c6d-94d2b5e2db43"
    width="100%"
    height="600px"
    frameborder="0"
    allow="clipboard-write"
  >
  </iframe>
</body>

UI Events in the Portal

When the Admin Portal is embedded in your application via an iframe, it can emit events to the parent window. You can capture these events using the window.onmessage method.

Listening to Portal Events in the UI
window.onmessage = event => {
  if (
    event.origin === '<SCALEKIT_ENVIRONMENT_URL>' && // 'https://yourapp.scalekit.dev'
    event.data &&
    event.data.event_type === 'ORGANIZATION_SSO_ENABLED' // Check for the specific event type
  ) {
    console.log(event.data); // Handle the event data
  }
};

Below is an example of the data structure you might receive in your browser console when the ORGANIZATION_SSO_ENABLED event is triggered:

Event Data in Browser Console
Loading...
note
  1. The domain of your parent window must be listed in the Scalekit Dashboard > API Config > Redirect URIs for security purpose
  2. Always validate the event.origin to ensure events are coming from a trusted source.

Important Considerations

  1. The generated link is designed for one-time use and expires after 1 minute.
  2. The embedded portal session times out after 6 hours, requiring administrators to complete the configuration within this period.
  3. Ensure your domain is listed as one of the Redirect URIs in the Scalekit Dashboard > API Config.
  4. Once activated, the IT admin can configure SSO for an extended period. The session remains active until the setup is complete.

The Admin Portal can be customized to match your brand's logo and colors. Refer to the Customize Admin Portal Guide for more information.


Is this page helpful? Yes No