SAML metadata reference
ulex's SAML 2.0 metadata documents in full: IdP metadata for relying parties, SP metadata for upstream IdPs, every element, every binding, every ulex extension, and how to read the entityID, ACS and SLO URLs.
Two documents, both EntityDescriptor, both served as application/samlmetadata+xml.
| Document | Endpoint | Consumed by | Credential |
|---|---|---|---|
| IdP metadata | GET /api/v1/applications/{id}/metadata | your relying party | none |
| IdP metadata for a connection | GET /api/v1/connections/{id}/saml/metadata | ulex, as an SP | none |
Both are public documents. IdPs fetch them with no credential, so they are unrate-limited and must never contain anything secret.
#1. ulex as IdP — your relying party consumes this
curl -sS "$BASE/applications/app_01M3PSV7J8TBSPHG95CYSEX32B/metadata"<?xml version="1.0" encoding="UTF-8"?>
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
entityID="https://ulexid.com/api/v1/applications/app_01M3PSV7J8TBSPHG95CYSEX32B"
validUntil="2027-03-11T00:00:00Z">
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>j2K0m1sT5yP9rB3kD6fG1aH0mNqU4wE7iO2pL5xC8vB1nMg==</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>8JmQ1vZ0Xh4n7cW2sT5yP9rB3kD6fG1aH0mNqU4wE7iO2pL5xC8vB1nMg0jKhR3t…</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data><ds:X509Certificate>MIIDQjCCAiqgAwIBAgIGATz/FuLiMA0GCSqGSIb3DQ…</ds:X509Certificate></ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<IDPSSODescriptor WantAuthnRequestsSigned="false"
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data><ds:X509Certificate>MIIDQjCCAiqgAwIBAgIGATz/FuLi…</ds:X509Certificate></ds:X509Data>
</ds:KeyInfo>
</KeyDescriptor>
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://ulexid.com/api/v1/auth/app_01M3PSV7J8TBSPHG95CYSEX32B/sso"/>
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://ulexid.com/api/v1/auth/app_01M3PSV7J8TBSPHG95CYSEX32B/sso"/>
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://ulexid.com/api/v1/auth/app_01M3PSV7J8TBSPHG95CYSEX32B/slo"/>
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://ulexid.com/api/v1/auth/app_01M3PSV7J8TBSPHG95CYSEX32B/slo"/>
<AttributeConsumingService index="1">
<ServiceName xml:lang="en">Acme Support</ServiceName>
<ServiceDescription xml:lang="en">ulex SAML identity provider for Acme Support</ServiceDescription>
<RequestedAttribute Name="email" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="1"/>
<RequestedAttribute Name="firstName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="lastName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="displayName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="title" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="department" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="groups" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="org_id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="1"/>
<RequestedAttribute Name="org_slug" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="org_role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="sid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="auth_time" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
<RequestedAttribute Name="amr" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" isRequired="0"/>
</AttributeConsumingService>
</IDPSSODescriptor>
<Organization>
<OrganizationName xml:lang="en">ulex</OrganizationName>
<OrganizationDisplayName xml:lang="en">ulex</OrganizationDisplayName>
<OrganizationURL xml:lang="en">https://ulexid.com</OrganizationURL>
</Organization>
<ContactPerson contactType="technical">
<GivenName>ulex</GivenName>
<SurName>Support</SurName>
<EmailAddress>support@ulexid.com</EmailAddress>
</ContactPerson>
</EntityDescriptor>#Element reference
| Element | Meaning |
|---|---|
@entityID | the stable identifier. https://ulexid.com/api/v1/applications/{applicationId}. Also the default expected Issuer in every assertion and the default expected Audience you should check yours against |
@validUntil | when the document must be re-fetched. Currently one year from the signing certificate's issue date |
@cacheDuration | absent. Fetch at least daily |
@IDPSSODescriptor/@WantAuthnRequestsSigned | false. ulex does not require signed AuthnRequests from SPs |
KeyDescriptor[@use="signing"] | the certificate that signs assertions. Refresh from GET /applications/{id}/secret; it rotates with the tenant signing keys |
NameIDFormat | persistent. The NameID is the ulex usr_… id and does not change when the user's email does |
SingleSignOnService | two bindings, same Location. Redirect is preferred; POST is available for IdPs that cannot do Redirect |
SingleLogoutService | two bindings, same Location |
AttributeConsumingService | what ulex emits, and which attributes your SP should request. email and org_id are isRequired="1" |
Organization | static. Not per-tenant |
ContactPerson | static support contact. Not a real inbox |
#Bindings
| Binding | URN | ulex endpoint |
|---|---|---|
| HTTP-Redirect | urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect | GET /api/v1/auth/{appId}/sso |
| HTTP-POST | urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST | POST /api/v1/auth/{appId}/sso |
| HTTP-Artifact | urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact | not supported |
| SOAP | urn:oasis:names:tc:SAML:2.0:bindings:SOAP | not supported |
If a customer's IdP only offers Artifact or SOAP, it cannot federate. Say so early.
#ulex metadata extensions
These are not part of any SAML specification. They appear in the namespace https://ulexid.com/saml/metadata.
<ulex:DeploymentEnvironment xmlns:ulex="https://ulexid.com/saml/metadata">prod</ulex:DeploymentEnvironment>
<ulex:OrganizationSlug xmlns:ulex="https://ulexid.com/saml/metadata">acme</ulex:OrganizationSlug>
<ulex:MockSso xmlns:ulex="https://ulexid.com/saml/metadata">true</ulex:MockSso>
<ulex:SupportsSingleLogout xmlns:ulex="https://ulexid.com/saml/metadata">true</ulex:SupportsSingleLogout>| Extension | Values | Use |
|---|---|---|
DeploymentEnvironment | prod (or local dev in npx @ulexid/mcp-server) | identifies the issuing control-plane environment |
OrganizationSlug | the slug | display only |
MockSso | true | false | a mock_sso connection is a simulator. If an SP checks this, it can refuse to federate on non-mock workloads |
SupportsSingleLogout | true | false | avoids a half-configured SLO |
Ignoring unknown-namespace elements is required of every conformant SP. Do not make your SP reject ulex's metadata for containing extensions.
#2. ulex as SP — the customer's IdP metadata
curl -sS "$BASE/connections/con_01M3PSVY108K5TEHHQ82WN30YK/saml/metadata"<?xml version="1.0" encoding="UTF-8"?>
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
entityID="https://globex.okta.com/app/exk9r2mz1hRtXQ2N5s0d7"
validUntil="2027-04-18T00:00:00Z">
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">…</ds:Signature>
<IDPSSODescriptor WantAuthnRequestsSigned="false"
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data><ds:X509Certificate>MIIE1DCCA3CgAwIBAgIULSJ…</ds:X509Certificate></ds:X509Data>
</ds:KeyInfo>
</KeyDescriptor>
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
<NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://globex.okta.com/app/exk9r2mz1hRtXQ2N5s0d7/sso/saml"/>
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="https://globex.okta.com/app/exk9r2mz1hRtXQ2N5s0d7/sso/saml"/>
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://globex.okta.com/app/exk9r2mz1hRtXQ2N5s0d7/slo/saml"/>
<AttributeConsumingService index="0">
<ServiceName xml:lang="en">Globex SSO</ServiceName>
<RequestedAttribute Name="email"/>
<RequestedAttribute Name="firstName"/>
<RequestedAttribute Name="lastName"/>
<RequestedAttribute Name="userId"/>
<RequestedAttribute Name="groups"/>
</AttributeConsumingService>
</IDPSSODescriptor>
</EntityDescriptor>This is the customer's document, normalised by ulex into the same shape. ulex does not verify the signature on an IdP metadata document; it does not need to, because the certificate in it is exactly what the connection was configured with. The security boundary is the connection's x509_certificate, not the metadata URL.
| Field | Maps to |
|---|---|
@entityID | config.saml.entity_id. Must equal the Issuer in signed assertions |
KeyDescriptor | config.saml.x509_certificate. Manually uploaded, not read from here |
SingleSignOnService | config.saml.sso_url. If the metadata lists several, the one matching config.saml.binding is used |
SingleLogoutService | config.saml.slo_url |
NameIDFormat | the list ulex will accept. If the requested format is not in the connection's name_id_format, the assertion is 400 saml_response_invalid |
AttributeConsumingService | informational. ulex maps by attribute_mapping, not by the customer's declared list |
@validUntil | surfaced in POST /connections/{id}/verify as certificate_not_expired |
#3. What ulex emits in an assertion
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_8JmQ1vZ0Xh4n7cW2sT5yP9rB3kD6fG1aH0mN"
Version="2.0" IssueInstant="2026-09-29T14:45:12Z"
Destination="https://app.example.com/saml/acs"
InResponseTo="_4Kq9WmB2yLt7NxZ1pRc6HdE0sJg3AuV8">
<saml:Issuer>https://ulexid.com/api/v1/applications/app_01M3PSV7J8TBSPHG95CYSEX32B</saml:Issuer>
<samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status>
<saml:Assertion ID="_aH0mNqU4wE7iO2pL5xC8vB1nMg0jKhR3t"
Version="2.0" IssueInstant="2026-09-29T14:45:12Z">
<saml:Issuer>https://ulexid.com/api/v1/applications/app_01M3PSV7J8TBSPHG95CYSEX32B</saml:Issuer>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent">usr_01M3PSV9GRT8GQGEG686AR1W9S</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData NotOnOrAfter="2026-09-29T14:45:17Z"
InResponseTo="_4Kq9WmB2yLt7NxZ1pRc6HdE0sJg3AuV8"
Recipient="https://app.example.com/saml/acs"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2026-09-29T14:45:07Z" NotOnOrAfter="2026-09-29T14:45:17Z">
<saml:AudienceRestriction>
<saml:Audience>https://app.example.com/saml/metadata</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2026-09-29T14:45:12Z" SessionIndex="_s1x8Kq2WmB4yLt7">
<saml:AuthnContext>
<saml:AuthnContextClassRef>urn:ulex:acr:mfa</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute Name="email"><saml:AttributeValue>dana@acme.example</saml:AttributeValue></saml:Attribute>
<saml:Attribute Name="org_id"><saml:AttributeValue>org_01M3PSV8HGTKQFCAYF9GDWGN3C</saml:AttributeValue></saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>| Element | Value | Your SP must check |
|---|---|---|
Response/@Destination | your ACS URL | yes, exactly |
Response/@InResponseTo | your AuthnRequest ID | yes, unless the login was IdP-initiated |
Response/Issuer | the metadata entityID | yes |
Assertion/Subject/NameID | the ulex usr_… id | key your user table on this |
SubjectConfirmationData/@Recipient | your ACS URL | yes |
SubjectConfirmationData/@NotOnOrAfter | +300 s | yes |
Conditions/@NotBefore | −300 s | yes |
Conditions/@NotOnOrAfter | +300 s | yes |
AudienceRestriction/Audience | your SP entity id | yes |
AuthnStatement/@AuthnInstant | when they authenticated | for your own session bookkeeping |
SessionIndex | the ulex session | for SLO correlation |
AuthnContextClassRef | an urn:ulex:acr:* value | for MFA policy |
Assertion/@ID | unique | reject a repeat |
The assertion window is 5 minutes in both directions. A consumer configured to reject assertions older than 60 seconds will fail intermittently; that looks like flakiness and is a misconfiguration.
#4. Reading a document
# The four values every integration needs, from the IdP metadata.
curl -sS "$BASE/applications/$APP_ID/metadata" \
| xmllint --xpath 'concat(
string(/*[local-name()="EntityDescriptor"]/@entityID), " ",
string(//*[local-name()="SingleSignOnService"][1]/@Location), " ",
string(//*[local-name()="SingleLogoutService"][1]/@Location), " ",
string(//*[local-name()="NameIDFormat"][1])
)' -https://ulexid.com/api/v1/applications/app_01M3PSV7J8TBSPHG95CYSEX32B https://ulexid.com/api/v1/auth/app_01M3PSV7J8TBSPHG95CYSEX32B/sso https://ulexid.com/api/v1/auth/app_01M3PSV7J8TBSPHG95CYSEX32B/slo urn:oasis:names:tc:SAML:2.0:nameid-format:persistent// Or just let the library do it. Do not hand-roll a SAML parser.
import { Metadata } from "samlify";
const md = await Metadata.fromUrl(`${base}/api/v1/applications/${appId}/metadata`);
console.log(md.entityID, md.idpSsoDescriptor!.singleSignOnService![0]!.location);#5. Certificate and rotation
curl -sS "$BASE/applications/$APP_ID/secret" -H "Authorization: Bearer $ULEX_API_KEY" | jq -r '.saml_signing_certificate, .saml_signing_certificate_expires_at'The certificate rotates with the tenant's signing keys. Cache it, and re-fetch on a schedule shorter than its lifetime.
const CERT_TTL_MS = 7 * 24 * 60 * 60_000; // 7 days; certs live a year
let cachedCert: { pem: string; fetchedAt: number } | null = null;
export async function ulexSamlCert(): Promise<string> {
if (!cachedCert || Date.now() - cachedCert.fetchedAt > CERT_TTL_MS) {
const res = await fetch(`${base}/api/v1/applications/${appId}/secret`, {
headers: { Authorization: `Bearer ${process.env.ULEX_API_KEY!}` },
});
if (!res.ok) throw new Error(`ulex /applications/{id}/secret returned ${res.status}`);
const body = (await res.json()) as { saml_signing_certificate: string };
cachedCert = { pem: body.saml_signing_certificate, fetchedAt: Date.now() };
}
return cachedCert.pem;
}A SP that pins a certificate in a config file breaks once a year. A SP that reads it from the metadata URL, or caches it with a short TTL, does not.
When the tenant's signing key rotates, ulex serves both certificates in KeyDescriptor for the grace window. Prefer a SP that accepts any KeyDescriptor in the document over one that indexes [1].
#6. Validating a document
xmllint --noout <(curl -sS "$BASE/applications/$APP_ID/metadata") && echo "well-formed"well-formedIf you verify the metadata's ds:Signature yourself, use RS256 with exclusive canonicalisation and a Reference URI="". ulex signs the document so you can detect a man-in-the-middle between you and ulex; it is not required by the SAML profile and many IdPs omit it.