Whatever message this page gives is out now! Go check it out!
| Field | Description |
| Name | Name of the Service Provider configuration to be configured. |
| Description | Description of the SP. |
| Entity Id | A unique identifier for the SP. Each instance of SP must have a different Entity Id. |
| ACS (Assertion Consumer Service) URL | The location where the SAML assertion is sent. This is often referred to as SAML ACS URL for your application. |
| ACS Binding | The SAML response is prepared according to the configuration provided by Identity Provider, encoded to base 64 string and loaded into the request based on this configuration. The HTTP-Redirect binding inserts the base 64 encoded string into the URL, while the HTTP-POST binding inserts the base 64 encoded string as a hidden FORM element. Takes the value “REDIRECT”/”POST". |
| SLO URL | The location where the logout response needs to be sent. |
| SLO Binding | Defines how the various protocol messages are to be exchanged between the SP and the IDP. Takes the value “REDIRECT”/”POST” |
| Sign Requests | Enable to sign requests from the SP with the private key. |
| Want Assertions Signed | Indicates whether the SP wants the Assertion response from the IDP to be signed. |
| Logout Response Signed | Enable to sign the logout response to be sent from the SP |
| Signing KeyStore Path | Path of the KeyStore that you had created with private/public keypair |
| Signing KeyStore Password | Password of the KeyStore. |
| Signing KeyStore Alias | Alias of entry in the KeyStore. |
| Request Store | Request store helps match outgoing requests and incoming responses with the Identity Provider to help protect against Replay Attacks. SAML requests can be tracked using one of the following storage methods.
ColdFusion has been using EHCache for replay attack, but it makes it difficult in cluster, when you have to go edit the XML for all the instances. The second option is cache. After installing caching module, you can specify server level cache in ColdFusion administrator. As well as in Application.cfc we can specify caching settings. If cache option is selected, we will use those cache settings to store And the last option is Redis. If you have configured Redis session storage in ColdFusion Admin it will use that setting. Redis is used because all instances will point to one Redis so cluster scenario is easy The Request Store option can be provided in Admin page or using Application.cfc by specifying the property “REQUESTSTORE” while adding SP. It takes values of "Cache" and "Redis" For example, this.security.samlsettings.sp = [{ name: 'sp1', entityId: 'admin1', acsURL: 'http://localhost:89/App1/response.cfm', sloURL: 'http://localhost:89/App1/logout.cfm', ACSBINDING: 'post', SLOBINDING: 'post', SIGNREQUESTS: true, WANTASSERTIONSSIGNED: true, LOGOUTRESPONSESIGNED: true, SIGNKEYSTOREPATH: 'C:/okta.p12', SIGNKEYSTOREPASSWORD: 'abcdef', SIGNKEYSTOREALIAS: 'selfsigned', REQUESTSTORE: 'Redis' }]; |
| Field | Description |
Name | Specify the name of the Identity Provider to be created. |
Description | Description of the Identity Provider. |
Entity Id | A uniquely identifiable identifier for the IDP. Each instance of IDP must have a different entity ID. |
SSO URL | The URL which points to the SSO service of the IDP. |
SLO URL | The URL which points to the SSO logout service of the IDP |
SSO Binding | Takes the value “REDIRECT”/”POST” as explained below. |
SLO Binding | Takes the value “REDIRECT”/”POST” as explained below. |
POST binding | The SAML request is prepared, encoded to base 64 string and loaded into a HTML form as one of the form input fields. You can provide any template path which has a form using the “template” parameter in functions InitSAMLAuthRequest / InitSAMLLogoutRequest. Refer cfinstance/wwwroot/WEB-INF/saml/login.cfm for an example |
REDIRECT binding | The SAML request is prepared, encoded into a base 64 string and is loaded into the URL as a query parameter. |
Sign Requests | Enable this option if you want the request to be signed. |
Encrypt Requests | Enable this option if you want the request to be encrypted. |
Sign Certificate and Encrypt Certificate | Create your own certificate using, for example, keytool, and upload it to CF Administrator. |
component {
this.name = 'sampleApp';
this.security.samlsettings.idp = [
{
name: 'idpt',
entityID: 'http://www.linktoentityid.com',
ssoURL: 'https://entityid.com/sso/saml',
sloURL: 'https://entityid.com/slo/saml',
ssoBinding: 'POST',
sloBinding: 'REDIRECT',
signMessage: true,
signrequests: true,
encryptrequests: false,
signcertificate: 'ABCDEF...'
}
]
this.security.samlsettings.sp = [
{
name: 'spt',
entityId: 'admin',
acsURL: 'http://localhost:8500/response.cfm',
sloURL: 'http://localhost:8500/logout.cfm',
acsbinding: 'POST',
slobinding: 'REDIRECT',
signrequests: true,
wantassertionssigned: true,
logoutresponsesigned: true,
signkeystorepath: 'C:\ColdFusion\cfusion\lib\okta.p12',
signkeystorepassword: 'abcdef',
signkeystorealias: 'selfsigned',
requeststore: 'redis'
}
]
}InitSAMLAuthRequest(options)idp | Name of the Identity Provider. |
sp | Name of the Service Provider. |
relayState | A string token that is attached with the request. On succesful authentication with the IdP, this token is sent back in the SAMLResponse so that the user can be redirected to any page once authentication is done. |
template | The location of a template that can be used as an intermediate loading page before redirection to the IDP takes place. Valid only for POST bindings. |
lifetime | The time that the SAML request must be entertained while waiting for the response from the IDP. |
<cfset struct1 = StructNew()>
<cfset struct1.relaystate = "page">
<cfset struct1.idp = StructNew()>
<cfset struct1.idp.name = "idp1">
<!--- Specify the name of the idp added through ColdFusion admin page or Application.cfc --->
<cfset struct1.sp = StructNew()>
<!--- Give the name of the sp added through ColdFusion admin page or Application.cfc --->
<cfset struct1.sp.name = "sp1">
<cfdump var="#struct1#">
<cfscript>
InitSAMLAuthRequest(struct1);
</cfscript>GetSAMLAuthRequest(options)idp | Name of the Identity Provider. |
sp | Name of the Service provider. |
<cfset struct1 = StructNew()>
<cfset struct1.idp = StructNew()>
<cfset struct1.idp.name = "idp1">
<cfset struct1.sp = StructNew()>
<cfset struct1.sp.name = "sp1">
<cfset authreq=XmlParse("#GetSAMLAuthRequest(struct1)#")>
<cfdump var="#authreq#">ProcessSAMLResponse(idp, sp)idp | Name of the Identity Provider. |
sp | Name of the Service provider. |
<cfset RespStruct = "#ProcessSAMLResponse("idp1", "sp1")#">
<cfdump var="#RespStruct#">
<cfif RespStruct.AUTHENTICATED>
<cflogin>
<cfloginuser name="#RespStruct.NAMEID#" password="" roles="#ArrayToList(RespStruct.ATTRIBUTES)#">
</cflogin>
</cfif>InitSAMLLogoutRequest(options)idp | Name of the Identity Provider. |
sp | Name of the Service Provider. |
relayState | A string token that is attached with the request. On succesful authentication with the IdP, this token is sent back in the SAMLResponse so that the user can be redirected to any page once authentication is done. |
template | The location of a template that can be used as an intermediate loading page before redirection to the IDP takes place. Valid only for POST bindings. |
lifetime | The time that the SAML request must be entertained while waiting for the response from the IDP. |
<cfset struct1 = StructNew()>
<cfset struct1.idp = StructNew()>
<cfset struct1.idp.name = "idp1">
<cfset struct1.sp = StructNew()>
<cfset struct1.sp.name = "sp1">
<cfset struct1.lifetime = 600>
<cfset struct1.relaystate = "page">
<cfscript>
InitSAMLLogoutRequest(struct1);
</cfscript>GetSAMLLogoutRequest(options)idp | Name of the Identity Provider. |
sp | Name of the Service provider. |
<cfset struct1 = StructNew()>
<cfset struct1.idp = StructNew()>
<cfset struct1.idp.name = "idp1">
<cfset struct1.sp = StructNew()>
<cfset struct1.sp.name = "sp1">
<cfset authreq=XmlParse("#GetSAMLLogoutRequest(struct1)#")>
<cfdump var="#authreq#">issamlLogoutResponse()<cfif isSAMLLogoutResponse()>
<!--- dumping logout response--->
<cfset struct2 = "#ProcessSAMLResponse()#">
<cfdump var="#struct2#">isSamlLogoutRequest()<cfif isSamlLogoutRequest()>
<!--- dumping logout request--->
<cfset struct3 = "#ProcessSAMLLogoutRequest("logout2", "sp2")#">
<cfdump var="Logging out in App2" output="console">
<cfdump var="#struct3#" output="console">
<cfset SendSAMLLogoutResponse(#struct3.SESSIONINDEX#)>SendSAMLLogoutResponse(sessionIndex, idp, sp)sessionIndex | Uniquely identify the session being closed. |
idp | Name of the Identity Provider. |
sp | Name of the Service provider. |
<cfif isSamlLogoutRequest()>
<!--- dumping logout request--->
<cfset LogReq = "#ProcessSAMLLogoutRequest("idp1", "sp1")#">
<cfdump var="#LogReq#">
<cfset SendSAMLLogoutResponse(#LogReq.SESSIONINDEX#,"idp1", "sp1")>
</cfif>ProcessSAMLLogoutRequest(idp,sp)idp | Name of the Identity Provider. |
sp | Name of the Service provider. |
<cfif isSamlLogoutRequest()>
<!--- dumping logout request--->
<cfset LogReq = "#ProcessSAMLLogoutRequest("idp1", "sp1")#">
<cfdump var="#LogReq#">
<cfset SendSAMLLogoutResponse(#LogReq.SESSIONINDEX#,"idp1", "sp1")>
</cfif>GenerateSAMLSPMetadata()<cfset struct1 = StructNew()>
<cfset struct1.entityid = "generated_sp_id">
<cfset struct1.acsurl = "http://localhost:8500/acsurl.cfm">
<cfset struct1.slourl = "http://localhost:8500/slourl.cfm">
<cfscript>
sp = GenerateSAMLSPMetadata(struct1);
</cfscript>
<cfdump var="#sp#"><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
// Add metadata from URL
idpAlias="url"
idpMetadataUrl=”https://metadata-url/”
try{
myObj.addIdpMetadata(alias= idpAlias,url= idpMetadataUrl)
writeOutput("IDP Metadata added successfully")
}
catch (any e){
writeDump(e)
}
// Add metadata from file
idpAlias = “file”
idpMetadataFile = “/opt/metadata.xml”
try{
myObj.addIdpMetadata(alias= idpAlias,file= idpMetadataFile)
writeOutput("IDP Metadata added successfully")
}
catch (any e){
writeDump(e)
}
// Add raw metadata xml
idpAlias = “raw”
idpMetadataRaw = “<md:EntityDescriptor ......”
try{
myObj.addIdpMetadata(alias= idpAlias,rawxml= idpMetadataRaw)
writeOutput("IDP Metadata added successfully")
}
catch (any e){
writeDump(e)
}
// Add metadata manually
idpAlias = “manual”
idpSsoUrl = “http://idp.com/sso”
idpEntityId = “entity1”
try{
myObj.addIdpMetadata(alias= idpAlias,ssourl= idpSsoUrl, entityid = idpEntityId)
writeOutput("IDP Metadata added successfully")
}
catch (any e){
writeDump(e)
}
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
// setting up parameter values
spAlias="spAlias"
spDescription="sp description"
spEntityid="abc"
spAcsbinding="POST"
spAcsurl="http://localhost:8500/acsurl.cfm"
try{
myObj.addSpMetadata(alias = spAlias,
description = spDescription,
entityid = spEntityid,
acsbinding = spAcsbinding,
acsurl = spAcsurl)
writeOutput("SP added successfully")
}
catch (any e){
writeDump(e)
}
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
alias="myalias"
try{
myObj.deleteIdpMetadata(alias)
writeOutput("IDP deleted successfully")
}
catch (any e){
writeDump(e)
}
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
alias="spAlias"
try{
myObj.deleteSpMetadata(alias)
writeOutput("SP deleted successfully")
}
catch (any e){
writeDump(e)
}
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
alias="spAlias"
try{
myObj.ExportSpMetadata(alias)
writeOutput("SP exported successfully")
}
catch (any e){
writeDump(e)
}
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
alias="spAlias"
spMetadataDetails=myObj.getSpMetadata(alias)
writeDump(spMetadataDetails)
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
alias="spAlias"
spMetadataDetails=myObj.getSpMetadata(alias)
writeDump(spMetadataDetails)
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
oldalias="myalias"
newalias="newalias"
url="http://idp-url"
try{
myObj.modifyIdpMetadata(oldalias = oldalias,
newalias = newalias,
url = url)
writeOutput("IDP modified successfully")
}
catch(any e){
writeDump(e)
}
</cfscript><cfscript>
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("admin");
// Instantiate the security object.
myObj = createObject("component","CFIDE.adminapi.security")
oldalias="spAlias"
newalias="newalias"
acsurl = “http://sp.com”
entityid="http://entity-id-url/"
acsbinding="REDIRECT"
try{
myObj.modifySpMetadata(oldalias = oldalias,
newalias = newalias,
entityid = entityid,
acsurl = acsurl,
acsbinding = acsbinding)
writeOutput("SP modified successfully")
}
catch(any e){
writeDump(e)
}
</cfscript>