Skip to main content

SAML Server Profile

The SamlServerProfile service manages SAML server profile objects in Strata Cloud Manager, defining SAML Identity Provider (IdP) configurations for single sign-on authentication.

Class Overview

The SamlServerProfile class provides CRUD operations for SAML server profile objects. It is accessed through the client.saml_server_profile attribute on an initialized Scm instance.

from scm.client import Scm

client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id"
)

# Access the SamlServerProfile service
saml_profiles = client.saml_server_profile

Key Attributes

AttributeTypeRequiredDescription
namestrYesProfile name
idUUIDYes*Unique identifier (*response only)
entity_idstrYesEntity ID (max 1024 chars)
certificatestrYesCertificate name (max 63 chars)
sso_urlstrYesSingle Sign-On URL (max 255 chars)
sso_bindingsSamlSsoBindingsYesSSO binding type (post or redirect)
slo_bindingsSamlSloBindingsNoSLO binding type (post or redirect)
max_clock_skewintNoMaximum clock skew in seconds (1-900)
validate_idp_certificateboolNoValidate IDP certificate
want_auth_requests_signedboolNoWant authentication requests signed
folderstrNo*Folder location
snippetstrNo*Snippet location
devicestrNo*Device location

* Exactly one of folder, snippet, or device is required.

Methods

List SAML Server Profiles

Retrieves a list of SAML server profile objects with optional filtering.

# List all SAML server profiles in a folder
profiles = client.saml_server_profile.list(folder="Texas")

for profile in profiles:
print(f"Name: {profile.name}, Entity ID: {profile.entity_id}")

Parameters:

ParameterTypeRequiredDescription
folderstrNo*Folder in which the resource is defined
snippetstrNo*Snippet in which the resource is defined
devicestrNo*Device in which the resource is defined
exact_matchboolNoOnly return objects exactly in the container
exclude_foldersList[str]NoList of folders to exclude
exclude_snippetsList[str]NoList of snippets to exclude
exclude_devicesList[str]NoList of devices to exclude

* Exactly one of folder, snippet, or device is required.

Fetch a SAML Server Profile

Retrieves a single SAML server profile by name and container.

# Fetch a specific SAML server profile by name
profile = client.saml_server_profile.fetch(
name="corp-saml-idp",
folder="Texas"
)

print(f"Name: {profile.name}, SSO URL: {profile.sso_url}")

Parameters:

ParameterTypeRequiredDescription
namestrYesThe name of the SAML server profile
folderstrNo*Folder in which the resource is defined
snippetstrNo*Snippet in which the resource is defined
devicestrNo*Device in which the resource is defined

* Exactly one of folder, snippet, or device is required.

Create a SAML Server Profile

Creates a new SAML server profile object.

# Create a new SAML server profile
profile = client.saml_server_profile.create({
"name": "corp-saml-idp",
"folder": "Texas",
"entity_id": "https://idp.example.com/saml/metadata",
"certificate": "idp-signing-cert",
"sso_url": "https://idp.example.com/saml/sso",
"sso_bindings": "post",
"slo_bindings": "post",
"max_clock_skew": 60,
"validate_idp_certificate": True
})

print(f"Created profile: {profile.name} (ID: {profile.id})")

Parameters:

ParameterTypeRequiredDescription
dataDict[str, Any]YesDictionary containing the profile configuration

Update a SAML Server Profile

Updates an existing SAML server profile object.

# Fetch, modify, update
profile = client.saml_server_profile.fetch(name="corp-saml-idp", folder="Texas")
profile.max_clock_skew = 120
profile.want_auth_requests_signed = True
updated = client.saml_server_profile.update(profile)

print(f"Updated profile: {updated.name}")

Delete a SAML Server Profile

Deletes a SAML server profile object by ID.

# Delete by ID
client.saml_server_profile.delete("abcd1234-5678-9abc-def0-123456789abc")

Parameters:

ParameterTypeRequiredDescription
object_idstrYesThe UUID of the profile to delete

Use Cases

Okta SAML Integration

# Create a SAML profile for Okta
profile = client.saml_server_profile.create({
"name": "okta-saml",
"folder": "Texas",
"entity_id": "http://www.okta.com/exk1234567890",
"certificate": "okta-signing-cert",
"sso_url": "https://company.okta.com/app/paloalto/exk1234567890/sso/saml",
"sso_bindings": "post",
"slo_bindings": "redirect",
"max_clock_skew": 60,
"validate_idp_certificate": True,
"want_auth_requests_signed": True
})

Azure AD SAML Integration

# Create a SAML profile for Azure AD
profile = client.saml_server_profile.create({
"name": "azure-ad-saml",
"folder": "Texas",
"entity_id": "https://sts.windows.net/tenant-id/",
"certificate": "azure-ad-cert",
"sso_url": "https://login.microsoftonline.com/tenant-id/saml2",
"sso_bindings": "redirect",
"max_clock_skew": 120,
"validate_idp_certificate": True
})

Error Handling

from scm.exceptions import InvalidObjectError, MissingQueryParameterError

try:
profile = client.saml_server_profile.fetch(
name="corp-saml-idp",
folder="Texas"
)
except MissingQueryParameterError as e:
print(f"Missing parameter: {e.message}")
except InvalidObjectError as e:
print(f"Invalid object: {e.message}")
except Exception as e:
print(f"Unexpected error: {e}")