<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CAS Tutorial &#8211; FoxDevelop</title>
	<atom:link href="https://www.foxdevelop.com/category/c-en/cas-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.foxdevelop.com</link>
	<description>Independent Software Developer Studio</description>
	<lastBuildDate>Thu, 06 Aug 2026 08:06:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://www.foxdevelop.com/wp-content/uploads/2026/05/fox-svgrepo-com-1.png</url>
	<title>CAS Tutorial &#8211; FoxDevelop</title>
	<link>https://www.foxdevelop.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>CAS Implementation</title>
		<link>https://www.foxdevelop.com/2026/08/06/cas-implementation/</link>
					<comments>https://www.foxdevelop.com/2026/08/06/cas-implementation/#respond</comments>
		
		<dc:creator><![CDATA[jack]]></dc:creator>
		<pubDate>Thu, 06 Aug 2026 08:06:30 +0000</pubDate>
				<category><![CDATA[CAS Tutorial]]></category>
		<guid isPermaLink="false">https://www.foxdevelop.com/?p=7819</guid>

					<description><![CDATA[Implementation Idea of Legacy CAS Version Core Principle (CAS 1.0 Protocol) web.config Configuration Modern CAS server enforces HTTPS by default. casUrl must be set to https://127.0.0.1:8443/cas/ CasEnter.aspx Page Source 1. ...]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Implementation Idea of Legacy CAS Version</p>



<h4 class="wp-block-heading">Core Principle (CAS 1.0 Protocol)</h4>



<ol class="wp-block-list">
<li>User accesses protected page <code>/admin/admin.aspx</code></li>



<li><code>web.config</code> permission rules block anonymous users and auto‑redirect to login page <code>CasEnter.aspx</code></li>



<li><code>CasEnter.aspx</code> checks whether the URL contains the <code>ticket</code> query parameter</li>
</ol>



<ul class="wp-block-list">
<li>No ticket: Redirect to CAS server login endpoint and pass current site address as <code>service</code></li>



<li>Ticket present: Call <code>serviceValidate</code> API to validate ticket against CAS server</li>
</ul>



<ol class="wp-block-list">
<li>CAS responds with XML; parse out logged‑in username</li>



<li>Upon successful validation, invoke <code>FormsAuthentication.SetAuthCookie()</code> to issue local Forms auth ticket and redirect to target page</li>



<li>Subsequent requests to protected directories rely on ASP.NET Forms for login state recognition</li>
</ol>



<h4 class="wp-block-heading">web.config Configuration</h4>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">system.web</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">authentication</span> <span class="hljs-attr">mode</span>=<span class="hljs-string">"Forms"</span>&gt;</span>
    <span class="hljs-comment">&lt;!-- loginUrl points to CasEnter.aspx as CAS entry relay page --&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">forms</span> <span class="hljs-attr">loginUrl</span>=<span class="hljs-string">"CasEnter.aspx"</span> 
           <span class="hljs-attr">defaultUrl</span>=<span class="hljs-string">"admin/admin.aspx"</span> 
           <span class="hljs-attr">name</span>=<span class="hljs-string">".LoginFormsTicket"</span> 
           <span class="hljs-attr">path</span>=<span class="hljs-string">"/"</span> 
           <span class="hljs-attr">timeout</span>=<span class="hljs-string">"40"</span> 
           <span class="hljs-attr">protection</span>=<span class="hljs-string">"All"</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">forms</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">authentication</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">authorization</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">allow</span> <span class="hljs-attr">users</span>=<span class="hljs-string">"*"</span>/&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">authorization</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">system.web</span>&gt;</span>

<span class="hljs-comment">&lt;!-- Restrict admin directory, deny anonymous access --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">location</span> <span class="hljs-attr">path</span>=<span class="hljs-string">"admin"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">system.web</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">authorization</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">deny</span> <span class="hljs-attr">users</span>=<span class="hljs-string">"?"</span>/&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">authorization</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">system.web</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">location</span>&gt;</span></code></span></pre>


<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Modern CAS server enforces HTTPS by default. <code>casUrl</code> must be set to <code>https://127.0.0.1:8443/cas/</code></p>
</blockquote>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">appSettings</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- Address for CAS‑7 with trailing slash --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">add</span> <span class="hljs-attr">key</span>=<span class="hljs-string">"casUrl"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"https://127.0.0.1:8443/cas/"</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">appSettings</span>&gt;</span></code></span></pre>


<h4 class="wp-block-heading">CasEnter.aspx Page Source</h4>



<h5 class="wp-block-heading">1. CasEnter.aspx Markup</h5>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">%@</span> <span class="hljs-attr">Page</span> <span class="hljs-attr">Language</span>=<span class="hljs-string">"C#"</span> <span class="hljs-attr">AutoEventWireup</span>=<span class="hljs-string">"true"</span> <span class="hljs-attr">CodeBehind</span>=<span class="hljs-string">"CasEnter.aspx.cs"</span> <span class="hljs-attr">Inherits</span>=<span class="hljs-string">"CasStudy.Web.CasEnter"</span> %&gt;</span>
<span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">xmlns</span>=<span class="hljs-string">"http://www.w3.org/1999/xhtml"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>CAS Relay Login<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"form1"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">asp:Label</span> <span class="hljs-attr">ID</span>=<span class="hljs-string">"Label1"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">asp:Label</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">br</span> /&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">asp:HyperLink</span> <span class="hljs-attr">ID</span>=<span class="hljs-string">"HyperLink1"</span> <span class="hljs-attr">runat</span>=<span class="hljs-string">"server"</span>&gt;</span>Re‑Authenticate<span class="hljs-tag">&lt;/<span class="hljs-name">asp:HyperLink</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span></code></span></pre>


<h5 class="wp-block-heading">2. CasEnter.aspx.cs Code‑Behind</h5>



<p class="wp-block-paragraph"><br>API upgraded to CAS3.0 <code>p3/serviceValidate</code><br>Replaced deprecated WebClient with HttpClient </p>



<p class="wp-block-paragraph">Added self‑signed certificate compatibility (mandatory for local testing against modern CAS)<br>Namespace handling for CAS‑returned XML</p>


<pre class="wp-block-code"><span><code class="hljs language-xml">using System;
using System.Configuration;
using System.Net;
using System.Net.Http;
using System.Xml;
using System.Web.Security;

public partial class CasEnter : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string casHost = ConfigurationManager.AppSettings&#91;"casUrl"];
        string ticket = Request.QueryString&#91;"ticket"];
        string service = Request.Url.GetLeftPart(UriPartial.Path);

        // No ticket, redirect to CAS login page
        if (string.IsNullOrEmpty(ticket))
        {
            string redirectUrl = $"{casHost}login?service={Uri.EscapeDataString(service)}";
            Response.Redirect(redirectUrl);
            return;
        }

        // Validate ticket
        string username = ValidateTicket(casHost, ticket, service);
        if (string.IsNullOrEmpty(username))
        {
            Label1.Text = "Sorry, CAS authentication failed. Please try again.";
            HyperLink1.NavigateUrl = Request.Url.AbsolutePath;
        }
        else
        {
            // Issue Forms authentication ticket for local sign‑in
            FormsAuthentication.SetAuthCookie(username, false);
            // Redirect to target page
            Response.Redirect(FormsAuthentication.DefaultUrl);
        }
    }

    /// <span class="hljs-tag">&lt;<span class="hljs-name">summary</span>&gt;</span>
    /// CAS3.0 p3/serviceValidate ticket validation
    /// <span class="hljs-tag">&lt;/<span class="hljs-name">summary</span>&gt;</span>
    private string ValidateTicket(string casHost, string ticket, string service)
    {
        // Modern CAS recommends p3/serviceValidate (CAS3.0 protocol)
        string validateUrl = $"{casHost}p3/serviceValidate?ticket={Uri.EscapeDataString(ticket)}&amp;service={Uri.EscapeDataString(service)}";

        // Local test only: allow untrusted SSL certificates (remove in production!)
        ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, err) =&gt; true;

        using var httpClient = new HttpClient();
        string xml = httpClient.GetStringAsync(validateUrl).Result;

        XmlDocument doc = new XmlDocument();
        doc.LoadXml(xml);
        XmlNamespaceManager nsMgr = new XmlNamespaceManager(doc.NameTable);
        // CAS3 response XML namespace
        nsMgr.AddNamespace("cas", "http://www.yale.edu/tp/cas");

        // Locate user node
        XmlNode userNode = doc.SelectSingleNode("//cas:authenticationSuccess/cas:user", nsMgr);
        return userNode?.InnerText;
    }
}</code></span></pre>


<p class="wp-block-paragraph">CAS Implementation</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.foxdevelop.com/2026/08/06/cas-implementation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Installation</title>
		<link>https://www.foxdevelop.com/2026/08/06/installation/</link>
					<comments>https://www.foxdevelop.com/2026/08/06/installation/#respond</comments>
		
		<dc:creator><![CDATA[jack]]></dc:creator>
		<pubDate>Thu, 06 Aug 2026 07:45:00 +0000</pubDate>
				<category><![CDATA[CAS Tutorial]]></category>
		<guid isPermaLink="false">https://www.foxdevelop.com/?p=7803</guid>

					<description><![CDATA[Legacy Installation Guide‑ For CAS Versions Prior to 5.0 Dependencies 1. JDK Version: (JDK) Java 17Direct Link: Java Downloads &#124; Oracle ⚠️ Note: JDK7 is outdated and only compatible with ...]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Legacy Installation Guide‑ For CAS Versions Prior to 5.0</h3>



<ol class="wp-block-list">
<li>The CAS server is built with Java and requires two core runtime environments:</li>
</ol>



<ul class="wp-block-list">
<li><strong>JDK (Java Development Kit)</strong>: Includes the Java Virtual Machine (JVM) to execute Java programs and forms the fundamental runtime base.</li>



<li><strong>Tomcat (Web Container)</strong>: Used to host and run the CAS WAR web application.</li>
</ul>



<ol class="wp-block-list">
<li>Recommended installation sequence: <strong>Install JDK first → then install Tomcat</strong> (Tomcat automatically detects the local JDK during setup)</li>
</ol>



<h4 class="wp-block-heading">Dependencies</h4>



<h5 class="wp-block-heading">1. JDK</h5>



<p class="wp-block-paragraph">Version: (JDK) Java 17<br>Direct Link: <code><a href="https://www.oracle.com/cn/java/technologies/downloads/">Java Downloads | Oracle </a></code></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Note: JDK7 is outdated and only compatible with older CAS releases; avoid using it for new‑project deployments.</p>
</blockquote>



<h5 class="wp-block-heading">2. Apache Tomcat</h5>



<p class="wp-block-paragraph">Version: <strong>Tomcat (Windows Installer)</strong><br><a href="https://tomcat.apache.org/">Apache Tomcat® &#8211; Welcome!</a></p>



<h4 class="wp-block-heading">Installation Steps</h4>



<ol class="wp-block-list">
<li><strong>Install JDK</strong>
<ul class="wp-block-list">
<li>Launch the EXE installer; you may set a custom install directory</li>



<li>【Critical】After installation, configure system environment variables: <code>JAVA_HOME</code> and <code>Path</code>, so Tomcat can properly locate your Java runtime</li>
</ul>
</li>



<li><strong>Install Tomcat 7</strong>
<ul class="wp-block-list">
<li>Run the setup wizard; it will auto‑detect your pre‑installed JDK</li>



<li>Customise Tomcat port (defaults to 8080) and define admin account credentials</li>



<li>Options on the final setup screen:</li>



<li> <code>Run Apache Tomcat</code>: Check this box to start the Tomcat service automatically once you click Finish</li>



<li><code>Show Readme</code>: You can uncheck this; the documentation is not required for setup</li>



<li>Click <code>Finish</code> to complete installation</li>
</ul>
</li>
</ol>



<h4 class="wp-block-heading">Configuring SSL/HTTPS for Tomcat</h4>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Core requirement: <strong>The CAS protocol enforces HTTPS on the server side. Plain HTTP will not work</strong>, so you must configure an SSL certificate within Tomcat.</p>
</blockquote>



<ol class="wp-block-list">
<li>Use the built‑in JDK <code>keytool</code> utility to create a <strong>JKS keystore (self‑signed certificate)</strong></li>



<li>Edit Tomcat’s <code>conf/server.xml</code> file and enable the SSL connector</li>



<li>Restart Tomcat and test HTTPS by visiting <code>https://localhost:8443</code></li>
</ol>



<h4 class="wp-block-heading">Generate Self‑Signed Certificate (JKS)</h4>



<h5 class="wp-block-heading">Pre‑requisites</h5>



<ol class="wp-block-list">
<li>Create a folder for certificate storage, example: <code>C:\Keys</code></li>



<li><strong>Launch Command Prompt as Administrator</strong><br>&gt; On Windows 7/10/11, writing directly to the root of drive C under a normal CMD session triggers permission‑denied errors.</li>



<li>Navigate into the bin folder of your JDK/JRE installation</li>
</ol>


<pre class="wp-block-code"><span><code class="hljs language-javascript">cd <span class="hljs-string">"c:\Program Files\Java\jre\bin"</span></code></span></pre>


<p class="wp-block-paragraph">Generic command template (works with modern JDK releases)</p>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">keytool</span> <span class="hljs-selector-tag">-genkey</span> <span class="hljs-selector-tag">-alias</span> <span class="hljs-selector-tag">tomcat</span> <span class="hljs-selector-tag">-keyalg</span> <span class="hljs-selector-tag">RSA</span> <span class="hljs-selector-tag">-storepass</span> <span class="hljs-selector-tag">changeit</span> <span class="hljs-selector-tag">-keystore</span> <span class="hljs-selector-tag">c</span>:\<span class="hljs-selector-tag">Keys</span>\<span class="hljs-selector-class">.keystore</span> <span class="hljs-selector-tag">-validity</span> 36000</code></span></pre>


<h4 class="wp-block-heading">Parameter Reference</h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>-genkey</code></td><td>Generate a public‑private key pair</td></tr><tr><td><code>-alias tomcat</code></td><td>Custom alias name for this certificate</td></tr><tr><td><code>-keyalg RSA</code></td><td>Cryptographic algorithm; standard RSA</td></tr><tr><td><code>-storepass changeit</code></td><td><strong>Keystore password</strong> (remember this value, you will need it later for Tomcat setup)</td></tr><tr><td><code>-keystore c:\Keys\.keystore</code></td><td>Output path for the generated keystore file</td></tr><tr><td><code>-validity 36000</code></td><td>Certificate validity period in days</td></tr></tbody></table></figure>



<h5 class="wp-block-heading">Interactive Prompt Input</h5>



<p class="wp-block-paragraph">After running the command, supply the following values step‑by‑step:</p>



<ol class="wp-block-list">
<li>First and last name: Enter your domain name (any value is fine for lab environments)</li>



<li>Organisational unit, organisation, city, state or province, country code (cn)</li>



<li>Type <code>y</code> to confirm your entered details</li>



<li>Key password: <strong>Press Enter directly; reuse the same password as your keystore</strong></li>
</ol>



<h5 class="wp-block-heading">Command To Inspect Certificate</h5>


<pre class="wp-block-code"><span><code class="hljs language-php">keytool -<span class="hljs-keyword">list</span> -keystore <span class="hljs-string">"C:\Keys\.keystore"</span></code></span></pre>


<p class="wp-block-paragraph">Enter your password. Proper output confirms successful certificate creation.</p>



<h4 class="wp-block-heading">Configure SSL Connector Inside Tomcat server.xml</h4>



<ol class="wp-block-list">
<li>Open <code>Tomcat/conf/server.xml</code></li>



<li>Locate the commented‑out SSL Connector block, uncomment it and fill in your certificate path and keystore password</li>
</ol>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">Connector</span> <span class="hljs-attr">port</span>=<span class="hljs-string">"8443"</span> <span class="hljs-attr">protocol</span>=<span class="hljs-string">"HTTP/1.1"</span> <span class="hljs-attr">SSLEnabled</span>=<span class="hljs-string">"true"</span>
    <span class="hljs-attr">maxThreads</span>=<span class="hljs-string">"150"</span> <span class="hljs-attr">scheme</span>=<span class="hljs-string">"https"</span> <span class="hljs-attr">secure</span>=<span class="hljs-string">"true"</span>
    <span class="hljs-attr">clientAuth</span>=<span class="hljs-string">"false"</span> <span class="hljs-attr">sslProtocol</span>=<span class="hljs-string">"TLS"</span>
    <span class="hljs-attr">keystoreFile</span>=<span class="hljs-string">"C:\Keys\.keystore"</span>
    <span class="hljs-attr">keystorePass</span>=<span class="hljs-string">"changeit"</span> /&gt;</span></code></span></pre>


<h5 class="wp-block-heading">Parameter Breakdown</h5>



<ul class="wp-block-list">
<li><code>port="8443"</code>: Tomcat default HTTPS port (standard HTTPS runs on 443; switching to port 443 requires handling port‑binding permissions)</li>



<li><code>keystoreFile</code>: Full absolute filesystem path pointing to your generated certificate file</li>




<li><code>keystorePass</code>: The keystore password you set earlier with keytool</li>



<li><code>clientAuth="false"</code>: Client‑side certificate validation disabled (keep false for testing environments)</li>
</ul>



<h4 class="wp-block-heading">Validation Procedure</h4>



<p class="wp-block-paragraph">Start Tomcat and open this address in your web browser:<br><code>https://127.0.0.1:8443</code></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Browsers flag self‑signed certificates as “Not Secure”; this is expected behaviour. For production deployments you must obtain a valid CA‑signed certificate.</p>
</blockquote>



<h3 class="wp-block-heading">CAS Installation 5.0+</h3>



<h5 class="wp-block-heading">1. Obtain Artifacts</h5>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Starting from CAS 5.0+, the traditional <code>war + Tomcat</code> pattern has been dropped. Built on SpringBoot, <strong>CAS ships as a self‑contained executable Jar; an external Tomcat instance is no longer required</strong></p>
</blockquote>



<ol class="wp-block-list">
<li>CAS Server</li>
</ol>



<p class="wp-block-paragraph"><strong>Generate deployment artefact online via CAS Initializr</strong><br>https://casinitializr.apereo.org</p>



<h5 class="wp-block-heading">2. CAS Server Deployment Workflow</h5>



<ol class="wp-block-list">
<li>Open CAS Initializr</li>
</ol>



<ul class="wp-block-list">
<li>Select CAS Version: <code>7.0.x</code> (latest stable release)</li>



<li>Check core modules: <code>Core / Web / SSL</code></li>



<li>Generate and download <code>cas.war</code> or directly get the standalone <code>cas.jar</code></li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Pick one of the two packaging formats:</p>



<ul class="wp-block-list">
<li>Option A (Recommended): <strong>Standalone Jar</strong>, embeds Tomcat, ready‑to‑run out‑of‑the‑box</li>



<li>Option B: Legacy WAR package, deployable onto external Tomcat (not recommended)</li>
</ul>
</blockquote>



<ol start="2" class="wp-block-list">
<li>Deploy as Standalone Jar (mainstream approach)<br>1) Save the downloaded <code>cas.jar</code><br>2) Create config directory <code>./etc/cas/config</code> and add file <code>cas.properties</code><br>3) Startup command (Java 17 or newer is mandatory)</li>
</ol>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">java</span> <span class="hljs-selector-tag">-jar</span> <span class="hljs-selector-tag">cas</span><span class="hljs-selector-class">.jar</span></code></span></pre>


<ol start="3" class="wp-block-list">
<li>Port and HTTPS notes<br>Default embedded Tomcat port: <strong>8443 (HTTPS)</strong><br>Newer releases enforce HTTPS by default, matching the specification for older CAS versions.</li>
</ol>



<h5 class="wp-block-heading">3. Access URL</h5>


<pre class="wp-block-code"><span><code class="hljs language-javascript">https:<span class="hljs-comment">//127.0.0.1:8443/cas</span></code></span></pre>


<p class="wp-block-paragraph">Installation</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.foxdevelop.com/2026/08/06/installation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Introduction</title>
		<link>https://www.foxdevelop.com/2026/08/06/introduction/</link>
					<comments>https://www.foxdevelop.com/2026/08/06/introduction/#respond</comments>
		
		<dc:creator><![CDATA[jack]]></dc:creator>
		<pubDate>Thu, 06 Aug 2026 07:35:10 +0000</pubDate>
				<category><![CDATA[CAS Tutorial]]></category>
		<guid isPermaLink="false">https://www.foxdevelop.com/?p=7785</guid>

					<description><![CDATA[Concepts 1. CAS CAS (Central Authentication Service)An open‑source Web SSO (Single Sign‑On) framework originated from Yale University. 2. SSO (Single Sign‑On) 3. Three Roles in the SSO Ecosystem 4. Three ...]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Concepts</h3>



<h4 class="wp-block-heading">1. CAS</h4>



<p class="wp-block-paragraph"><strong>CAS (Central Authentication Service)</strong><br>An open‑source <strong>Web SSO (Single Sign‑On)</strong> framework originated from Yale University.</p>



<h4 class="wp-block-heading">2. SSO (Single Sign‑On)</h4>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Unify identity login verification for multiple web applications through one single endpoint.</p>



<ul class="wp-block-list">
<li>Features: Applications communicate over web protocols (HTTPS) with a <strong>global unified login entry point</strong></li>



<li>Plain explanation: Log in once at the authentication center within the same browser, and you can access all trusted services without repeated sign‑ins</li>
</ul>
</blockquote>



<h4 class="wp-block-heading">3. Three Roles in the SSO Ecosystem</h4>



<ol class="wp-block-list">
<li>User: End‑user (web browser)</li>



<li>Web Applications (multiple business systems)</li>



<li>SSO Authentication Center (singleton)</li>
</ol>



<h4 class="wp-block-heading">4. Three Core Principles of SSO</h4>



<ol class="wp-block-list">
<li>All account login operations <strong>must be performed at the SSO authentication center</strong>;</li>



<li>The authentication center provides mechanisms to notify each web application whether the current user has been authenticated;</li>



<li>Pre‑established trust relationships exist between the authentication center and all business web applications.</li>
</ol>



<h5 class="wp-block-heading">Two Core Components</h5>



<h4 class="wp-block-heading">CAS Server (Authentication Server‑Side)</h4>



<ul class="wp-block-list">
<li>Independently‑deployed web program, serving as the <strong>only authentication hub</strong></li>



<li>Responsibilities: Accept username and password credentials, validate user identity; issue tickets (Ticket), manage global session Cookie (TGC)</li>
</ul>



<h4 class="wp-block-heading">CAS Client (Embedded within each business system)</h4>



<ul class="wp-block-list">
<li>Hosted inside each business web application, usually implemented as a Filter</li>



<li>Responsibilities: Intercept requests for protected resources; redirect the browser to the CAS Server login page automatically when the user is unauthenticated</li>
</ul>



<h4 class="wp-block-heading">Workflow</h4>



<ol class="wp-block-list">
<li><strong>User accesses resources on a business system</strong> → CAS Client intercepts the request and detects no <code>Service Ticket</code> present</li>



<li>The Client <strong>redirects</strong> the browser to the CAS Server login URL, passing along the current business system address (Service)</li>



<li>User submits username and password on CAS Server to complete authentication
<ul class="wp-block-list">
<li>Successful login: CAS Server sets a <strong>TGC (Ticket Granting Cookie) global session cookie</strong> in the browser</li>



<li>One‑time ticket generated: <strong>Service Ticket (ST)</strong></li>
</ul>
</li>



<li>CAS Server redirects the browser back to the business system URL with <code>Ticket=xxx</code> appended as a URL parameter</li>



<li><strong>CAS Client on the business system makes a backend server‑to‑server call</strong> with Service address + Ticket to validate ticket legitimacy against CAS Server</li>



<li>CAS Server confirms valid ticket and returns user identity details such as username</li>



<li>Validation succeeds, business system creates local session and user can browse pages normally</li>
</ol>



<p class="wp-block-paragraph"> <strong>Purpose of TGC</strong>: As long as the browser holds the TGC Cookie, subsequent visits to other CAS‑integrated systems skip the login prompt and single sign‑on happens automatically.</p>



<p class="wp-block-paragraph">Introduction</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.foxdevelop.com/2026/08/06/introduction/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
