Starts the SAML Single Sign-On (SSO) login process by redirecting the user to an external login provider such as Okta, Azure AD, or ADFS. Before using this function, both the Identity Provider (IdP) and Service Provider (SP) must already be configured in ColdFusion Administrator or Application.cfc.
InitSAMLAuthRequest(options)
→ returns void
This example starts a SAML login request using Okta as the Identity Provider (IdP). The ColdFusion application acts as the Service Provider (SP). Both configurations must already exist in ColdFusion Administrator under Security > SAML.
<cfscript>
config = {
// External login provider
idp = {
name = "OktaIDP"
},
// ColdFusion application
sp = {
name = "EmployeePortal"
},
// Optional page to return after login
relayState = "dashboard"
};
// Redirect user to the login provider
InitSAMLAuthRequest(config);
</cfscript>
Expected Result: The user is redirected to the configured external login page for authentication.
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.