Skip to content

Instantly share code, notes, and snippets.

@bcswartz
Created November 24, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcswartz/46455767e4aca53f87e664839a4c4b16 to your computer and use it in GitHub Desktop.
Save bcswartz/46455767e4aca53f87e664839a4c4b16 to your computer and use it in GitHub Desktop.
First of 2 code blocks describing how to link JASIG CAS authentication with the Mura CMS
<cfif cgi.script_name EQ "/admin/index.cfm" and cgi.query_string EQ "">
<cfif IsDefined('session.mura') and session.mura.userId EQ "">
<cfif StructKeyExists(session,"NetId")>
<!---Look for an admin (type 2) account with the user identifier returned by CAS--->
<cfquery name="qry" datasource="{My Mura Datasource}">
select userId
from tUsers
where username= <cfqueryparam value="#session.NetId#" cfsqltype="cf_sql_varchar" />
and type= <cfqueryparam value="2" cfsqltype="cf_sql_numeric" />
</cfquery>
<cfscript>
loginData= StructNew();
loginData.userID= qry.userId;
loginData.siteId= "default";
loginData.isAdminLogin= true;
loginData.returnUrl= "index.cfm?fuseaction=cDashboard.main&siteid=default";
</cfscript>
<cfset StructDelete(session,"NetId")>
<cfset application.loginManager.loginByUserID(loginData,"")>
<cfelse>
<cflocation url="/adminCASLogin.cfm" />
</cfif>
</cfif>
</cfif>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment