SAML authentication for Admin Site / Workspace
Introduction
SAML authentication is set at site level under Site Management => Pragatix Settings.
Four options for SAML identity provider:
None - SAML is not configured (default)
AzureAD - Microsoft Entra ID (Azure AD) is used as the SAML provider
Okta - Okta is used as the SAML provider
Keycloak - Keycloak is used as the SAML provider
Important:
If some provider is configured (not None) - the whole site will work only with SAML and optionally Agat login (email) - Azure and Google authentication types will be not available for any account.
Must restart the Admin Site after changing SAML configuration
Required settings for SAML provider:
SAML Entity ID - copy value of “Microsoft Entra Identifier” from the Azure app or “IdP Entity ID / Issuer“ from Okta
In Azure app Single Sign-On settings:
SAML Metadata URL - copy the value of “App Federation Metadata Url” from the Azure app or “IdP Metadata URL” from Okta
In Azure app Single Sign-On settings:
Azure app for our testing: search for “Azure SAML Enterprise Application“ in LastPass
Microsoft Entra ID: basic SAML configuration
Create Enterprise application
In Properties set Assignment required? to No to allow all tenant users, or Yes and then add users to Users and groups.
Configure Single Sign On: add Admin Site URL to Identifier (Entity ID) and Reply URL:
Reply URL should finish with /Saml2/Acs
Admin Site request signing
When the identity provider requires signed SAML authentication requests, Admin Site signs each AuthnRequest with the private key of a certificate installed in LocalMachine\My on the Admin Site server. Upload only the matching public certificate to the identity provider.
Never export or upload the private key
Export the certificate as a public Base-64 encoded X.509 certificate (.cer). Do not export a .pfx file and do not provide the private key to the identity provider.
The application pool identity must have read access to the certificate's private key. The certificate must be current, have an RSA private key, and permit digital signatures. A TLS/SSL certificate can technically be reused when it meets these conditions, but a dedicated SAML signing certificate is recommended because it can be renewed and rotated independently from the website certificate.
Certificate installation and private-key permissions
Normally configured by the installer
When a SAML signing .pfx file is selected in the Pragatix installer, the installer imports the certificate and private key into LocalMachine\My and grants IIS AppPool\<Admin Site application pool name> read access to that certificate's private key. No additional manual permission step is normally required for an installer-managed certificate.
If the certificate is installed or replaced outside the installer, grant the permission manually:
Sign in to the Admin Site server with an administrator account and run
certlm.msc.Open Certificates (Local Computer) > Personal > Certificates.
Locate the exact certificate selected for SAML signing, right-click it, and select All Tasks > Manage Private Keys.
Select Add. Enter
IIS AppPool\<application-pool-name>, replacing the placeholder with the Admin Site IIS application-pool name, and select Check Names. For example, if the pool is namedAdminSite, enterIIS AppPool\AdminSite.Grant the identity Allow: Read. Full Control and Write permissions are not required.
Select Apply and OK, then restart or recycle the Admin Site application pool.
If Manage Private Keys is not available, confirm that the certificate is in the Local Computer Personal store and was imported with its private key. A public .cer file alone cannot be used by Admin Site to sign requests; the server-side certificate must include the private key.
Admin Site SAML settings
Install the certificate, including its private key, in
Certificates (Local Computer) > Personal > Certificates.Grant the Admin Site IIS application-pool identity read access to the certificate's private key.
Open Site Management > Pragatix Settings and select the SAML provider.
SAML authentication request signing behavior
This setting controls whether Admin Site digitally signs the SAML AuthnRequest that starts service-provider-initiated sign-in.
Value | Behavior | When to use it | Certificate required in Admin Site |
|---|---|---|---|
Never | Admin Site sends an unsigned authentication request. | Use only when the identity provider accepts unsigned requests. | No |
When required by identity provider | Admin Site signs the request only when the identity provider metadata declares that signed authentication requests are required. | Use when the provider publishes the requirement correctly in its SAML metadata. If the provider requires signatures but does not advertise this in metadata, Admin Site will not sign and sign-in will fail. | Yes, when signing is requested by the metadata |
Always | Admin Site signs every SAML authentication request. | Use when the provider is configured to require signed requests, especially when that requirement is not present in its metadata. For example, use this with Keycloak when Client Signature Required is enabled. | Yes |
Selecting the signing certificate
When the signing behavior is not Never, configure SAML Signing Certificate Thumbprint:
Select from the list: open the dropdown and choose the certificate that Admin Site should use. The list contains eligible certificates from
LocalMachine\Mythat are currently valid, have an RSA private key, allow digital signatures, and whose private key is accessible to the Admin Site process. Each option shows the certificate name and expiration date.Enter manually: choose Manual and paste the certificate thumbprint. Spaces and common invisible direction characters are removed when the thumbprint is processed. Manual entry does not install the certificate or grant permissions: the matching certificate must still exist in
LocalMachine\My, include an RSA private key, permit signing, be valid, and be readable by the IIS application-pool identity.
If Never is selected, the thumbprint is not required and Admin Site does not use a certificate to sign authentication requests.
The IdP must receive the public part of the same certificate
The certificate selected in Admin Site and the certificate imported into Microsoft Entra ID, Okta, or Keycloak must be the same certificate/key pair. Select the certificate in Admin Site, export that exact certificate's public key as a Base-64 encoded X.509 .cer file, and import that file into the SAML identity-provider configuration.
Admin Site keeps and uses the private key to create the signature. The identity provider receives only the public certificate and uses it to verify the signature. Selecting one certificate in Admin Site and importing a different certificate into the provider causes signature validation and sign-in to fail, even if both certificates have the same subject or friendly name.
Save the settings and restart the Admin Site.
Start sign-in from the Admin Site URL and confirm that the identity provider accepts the signed request.
Two different certificate roles
The Admin Site certificate described here is the service-provider certificate used to sign outgoing authentication requests. The identity provider's certificate, published in its metadata, is separately used by Admin Site to validate signed SAML responses and assertions.
Identity provider configuration
Microsoft Entra ID: verification certificate
In the Microsoft Entra admin center, go to Entra ID > Enterprise applications > All applications and open the Admin Site enterprise application.
Open Single sign-on.
Under SAML Certificates, locate Verification certificates (optional) and select Edit.
Select Require verification certificates.
Select Upload certificate, choose the public
.cerfile exported from the Admin Site certificate, and save the configuration.Leave Allow requests signed with RSA-SHA1 disabled. Admin Site uses RSA-SHA256.
After saving, the verification certificate should appear as active. Requiring verification certificates applies to service-provider-initiated sign-in. Microsoft Entra's Test single sign-on, My Apps, and Microsoft 365 app-launcher IdP-initiated flows are not suitable for testing this signed-request configuration; start sign-in from the Admin Site URL.
Okta
Create and configure the SAML application
In the Okta Admin Console, go to Applications > Applications, select Create App Integration, choose SAML 2.0, and continue.
Enter a name such as Pragatix Admin Site and continue to Configure SAML.
Configure the service-provider values. Replace
https://admin-site.example.comwith the public Admin Site URL:Single sign-on URL:
https://admin-site.example.com/Saml2/AcsKeep Use this for Recipient URL and Destination URL selected.
Audience URI (SP Entity ID): the exact Admin Site URL configured as the Admin Site application URL, for example
https://admin-site.example.com. The scheme, host, port, and trailing-slash form must match the issuer sent by Admin Site.Default RelayState: leave empty.
Name ID format: EmailAddress.
Application username: Email.
Under Attribute Statements, add:
Name
Name format
Value
Purpose
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressURI Reference
user.emailRequired. Admin Site uses it as the user's email and account domain.
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameURI Reference
user.firstName + " " + user.lastNameRecommended display name.
In Show Advanced Settings, use RSA-SHA256/SHA-256 and configure Okta to sign the SAML assertion or response. Leave assertion encryption disabled unless encryption has been configured separately in Admin Site.
Finish the wizard and assign the required users or groups to the application.
Copy the Okta identity-provider values to Admin Site
Open the application's Sign On tab and select View SAML setup instructions or open its metadata details.
Copy the Identity Provider Issuer into SAML Entity ID in Admin Site.
Copy the Okta Identity Provider metadata URL into SAML Metadata URL in Admin Site.
Require signed requests from Admin Site
Edit the application's SAML Settings and expand Show Advanced Settings.
Under Signature Certificate, upload the public certificate selected in Admin Site. Okta expects PEM certificate data. If necessary, convert the Base-64 X.509
.certo a PEM file with-----BEGIN CERTIFICATE-----and-----END CERTIFICATE-----markers.Enable Signed Requests, finish, and save.
Set Admin Site signing behavior to Always unless Okta metadata explicitly declares that signed authentication requests are required.
Okta's Signed Requests option requires the request to contain NameIDPolicy and makes Okta use URLs from the signed request instead of previously configured static requestable SSO URLs. Review the integration after enabling it.
Keycloak
Create and configure the SAML client
In the Keycloak Admin Console, select the realm, open Clients, and select Create client.
Set Client type to SAML.
Set Client ID to the exact external Admin Site URL, including a non-default port when used, for example
https://admin-site.example.com:4449. It must exactly match the issuer in the Admin Site SAML request.Save the client, then configure:
Root URL and Home URL: the exact external Admin Site URL.
Valid Redirect URIs:
https://admin-site.example.com:4449/Saml2/Acsandhttps://admin-site.example.com:4449/Saml2/Logout. Use exact URLs, not a broad wildcard.Master SAML Processing URL:
https://admin-site.example.com:4449/Saml2/Acs.Force POST Binding: enabled.
Name ID format: use the format configured for the stable user identifier emitted by Keycloak. Email is commonly used.
Sign Documents and/or Sign Assertions: enabled.
Signature Algorithm: RSA-SHA256.
Encrypt Assertions: disabled unless assertion encryption is configured separately.
Configure Keycloak to validate signed Admin Site requests
Open
https://admin-site.example.com:4449/Saml2/Metadataand confirm that it returns the Admin Site service-provider XML descriptor.In the Keycloak client, open Settings > Signature and Encryption.
Set Metadata descriptor URL to
https://admin-site.example.com:4449/Saml2/Metadata.Enable Use metadata descriptor URL. Keycloak then downloads and caches the Admin Site public signing certificate.
Open the Keys tab and enable Client Signature Required.
In Admin Site, set the SAML authentication request signing behavior to Always, save, and restart the Admin Site.
Do not confuse the two metadata URLs
Keycloak client > Metadata descriptor URL: Admin Site service-provider metadata,
https://admin-site.example.com:4449/Saml2/Metadata.Admin Site > SAML Metadata URL: Keycloak identity-provider metadata,
https://keycloak.example.com/realms/<realm-name>/protocol/saml/descriptor.
Using the Keycloak realm descriptor in the Keycloak client metadata field does not provide Keycloak with the Admin Site signing certificate and can cause Invalid requester.
If Use metadata descriptor URL is disabled, import the public certificate selected in Admin Site manually on the Keycloak Keys tab. Never upload the private key.
Configure user attributes
Open the client's Client scopes or Mappers configuration and ensure these values are emitted:
SAML value | Suggested Keycloak mapper | Purpose |
|---|---|---|
| User Property mapper, property | Required user email/UPN. Its suffix does not select the account when SAML Account Domain is configured. |
Subject NameID, | Use the AD-backed Keycloak username or an immutable user identifier. If a custom attribute is used, set the matching SAML User ID Claim Type in Admin Site. | Required stable provider user ID used to match repeat sign-ins. |
| User Property mapper for the user's display name, with NameFormat URI Reference. | Recommended display name. |
Copy the Keycloak identity-provider values to Admin Site
Select Keycloak as the SAML provider.
Set SAML Metadata URL to
https://keycloak.example.com/realms/<realm-name>/protocol/saml/descriptor.Open that descriptor and copy its exact
EntityDescriptor entityIDvalue into SAML Entity ID.
Migrate an existing Windows account
Set SAML Account Domain (
BG_SamlAccountDomain) to the existing Windows account domain, for exampleagat.lan, before enabling SAML.The Keycloak email/UPN may use a different suffix. The configured SAML account domain selects the existing Admin Site account.
Ensure each SAML identity can match exactly one existing Windows user by stable provider user ID, email, or company email. The account remains Windows until the first existing user is matched successfully, then it changes to SAML.
Do not add the Keycloak email suffix as a second database account domain only to make migration work.
Keycloak's realm certificate in the identity-provider metadata is used by Admin Site to validate Keycloak responses. It is separate from the Admin Site service-provider certificate that Keycloak uses to validate signed Admin Site requests.
Certificate renewal
Before the selected certificate expires, install the replacement certificate and grant the application pool access to its private key. Upload the replacement public certificate to the identity provider, select the replacement certificate in Admin Site, save, restart the site, and test service-provider-initiated sign-in before removing the old certificate.