You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by gi...@apache.org on 2021/05/18 21:34:56 UTC

[directory-site] branch asf-site updated: Updated site from master (22d6d23ae2f8c9abc15ebe34754e916be479f54e)

This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/directory-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 9846af2  Updated site from master (22d6d23ae2f8c9abc15ebe34754e916be479f54e)
9846af2 is described below

commit 9846af2daa501e76c901ee1c72672f690ca8b53a
Author: jenkins <bu...@apache.org>
AuthorDate: Tue May 18 21:34:52 2021 +0000

    Updated site from master (22d6d23ae2f8c9abc15ebe34754e916be479f54e)
---
 content/fortress/testimonials.html | 560 ++++++++++++++++++-------------------
 content/sitemap.xml                |   4 +-
 2 files changed, 276 insertions(+), 288 deletions(-)

diff --git a/content/fortress/testimonials.html b/content/fortress/testimonials.html
index e4b9890..ea097e3 100644
--- a/content/fortress/testimonials.html
+++ b/content/fortress/testimonials.html
@@ -158,299 +158,289 @@
 <h3 id="server-side-development">Server side development:</h3>
 <h4 id="1-the-authentication-handler">1. The Authentication Handler</h4>
 <p>The interesting part for this solution is how to maintain both the <a href="https://www.apereo.org/projects/cas">Apereo CAS</a> and Apache Fortress sessions. Luckily, <strong>CAS</strong> is using a token for maintaining their session and that token is also designed to have some extended attributes included with it.  Using this knowledge, we can modify the profile given by <strong>CAS</strong> Server to the client. Let&rsquo;s have a look what I&rsquo;ve done with combining the <a hre [...]
-<pre><code>:::Java
-
-/*
- * Copyright 2017 to PT. Global Digital Niaga(Blibli.com)
- * 
- * Licensed under the Apache License, Version 2.0; you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.gdn.iam.cas;
-
-import java.io.StringWriter;
-import java.security.GeneralSecurityException;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-
-import org.apache.directory.fortress.core.AccessMgr;
-import org.apache.directory.fortress.core.model.Session;
-import org.apache.directory.fortress.core.model.User;
-import org.jasig.cas.authentication.HandlerResult;
-import org.jasig.cas.authentication.PreventedException;
-import org.jasig.cas.authentication.UsernamePasswordCredential;
-import org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class IamAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler {
-
-  private static final Logger LOG = LoggerFactory.getLogger(IamAuthenticationHandler.class);
-
-  private AccessMgr accessManager;
-  private JAXBContext jaxbContext;
-  private Marshaller marshaller;
-
-  public IamAuthenticationHandler() {
-    try {
-      jaxbContext = JAXBContext.newInstance(Session.class);
-      marshaller = jaxbContext.createMarshaller();
-    } catch (JAXBException e) {
-      LOG.error(&quot;cannot bind Session with jaxb context&quot;, e);
-    }
-  }
-
-  @Override
-  protected HandlerResult authenticateUsernamePasswordInternal(
-      UsernamePasswordCredential usernamePasswordCredential)
-          throws GeneralSecurityException, PreventedException {
-    String username = usernamePasswordCredential.getUsername();
-    String password = usernamePasswordCredential.getPassword();
-    Session iamSession = null;
-    String iamXmlSession = null;
-    try {
-      LOG.trace(&quot;trying to authenticate username : {}, password : {}&quot;,
-          new Object[] {username, password});
-      iamSession = accessManager.createSession(new User(username, password.toCharArray()), false);
-      LOG.trace(&quot;iam session : {}&quot;, iamSession);
-      if (iamSession != null) {
-        StringWriter writer = new StringWriter();
-        marshaller.marshal(iamSession, writer);
-        iamXmlSession = writer.toString();
-        LOG.trace(&quot;iam xml session : {}&quot;, iamXmlSession);
-        Map&lt;String, Object&gt; attributes = new HashMap&lt;&gt;();
-        attributes.put(&quot;iamSession&quot;, iamXmlSession);
-        return createHandlerResult(usernamePasswordCredential,
-            principalFactory.createPrincipal(username, attributes), null);
-      }
-    } catch (org.apache.directory.fortress.core.SecurityException e) {
-      String errorMessage = &quot;IAM authentication failed for [&quot; + username + &quot;]&quot;;
-      LOG.trace(errorMessage);
-      throw new GeneralSecurityException(errorMessage);
-    } catch (JAXBException e) {
-      String errorMessage = &quot;cannot marshalling session with value : &quot; + iamSession == null ? &quot;null&quot;
-          : iamSession.toString();
-      LOG.trace(errorMessage);
-      throw new GeneralSecurityException(errorMessage);
-    }
-    LOG.trace(&quot;returning default handler&quot;);
-    return createHandlerResult(usernamePasswordCredential,
-        principalFactory.createPrincipal(username), null);
-  }
-
-  public AccessMgr getAccessManager() {
-    return accessManager;
-  }
-
-  public void setAccessManager(AccessMgr accessManager) {
-    this.accessManager = accessManager;
-  }
-
-}
-</code></pre>
-<p>In the above source code you can see how I construct a new principal by creating a new attribute map with values contained withing the <em>Apache Fortress</em> Session xml.</p>
+<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-Java" data-lang="Java">
+    <span style="color:#080;font-style:italic">/*
+</span><span style="color:#080;font-style:italic">     * Copyright 2017 to PT. Global Digital Niaga(Blibli.com)
+</span><span style="color:#080;font-style:italic">     * 
+</span><span style="color:#080;font-style:italic">     * Licensed under the Apache License, Version 2.0; you may not use this file except in compliance
+</span><span style="color:#080;font-style:italic">     * with the License. You may obtain a copy of the License at
+</span><span style="color:#080;font-style:italic">     * 
+</span><span style="color:#080;font-style:italic">     * http://www.apache.org/licenses/LICENSE-2.0
+</span><span style="color:#080;font-style:italic">     * 
+</span><span style="color:#080;font-style:italic">     * Unless required by applicable law or agreed to in writing, software distributed under the License
+</span><span style="color:#080;font-style:italic">     * is distributed on an &#34;AS IS&#34; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+</span><span style="color:#080;font-style:italic">     * or implied. See the License for the specific language governing permissions and limitations under
+</span><span style="color:#080;font-style:italic">     * the License.
+</span><span style="color:#080;font-style:italic">     */</span>
+    <span style="color:#a2f;font-weight:bold">package</span> <span style="color:#00f;font-weight:bold">com.gdn.iam.cas</span><span style="color:#666">;</span>
+    
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">java.io.StringWriter</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">java.security.GeneralSecurityException</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">java.util.HashMap</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">java.util.Map</span><span style="color:#666">;</span>
+    
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">javax.xml.bind.JAXBContext</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">javax.xml.bind.JAXBException</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">javax.xml.bind.Marshaller</span><span style="color:#666">;</span>
+    
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.apache.directory.fortress.core.AccessMgr</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.apache.directory.fortress.core.model.Session</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.apache.directory.fortress.core.model.User</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.jasig.cas.authentication.HandlerResult</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.jasig.cas.authentication.PreventedException</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.jasig.cas.authentication.UsernamePasswordCredential</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.slf4j.Logger</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.slf4j.LoggerFactory</span><span style="color:#666">;</span>
+    
+    <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#a2f;font-weight:bold">class</span> <span style="color:#00f">IamAuthenticationHandler</span> <span style="color:#a2f;font-weight:bold">extends</span> AbstractUsernamePasswordAuthenticationHandler <span style="color:#666">{</span>
+    
+      <span style="color:#a2f;font-weight:bold">private</span> <span style="color:#a2f;font-weight:bold">static</span> <span style="color:#a2f;font-weight:bold">final</span> Logger LOG <span style="color:#666">=</span> LoggerFactory<span style="color:#666">.</span><span style="color:#b44">getLogger</span><span style="color:#666">(</span>IamAuthenticationHandler<span style="color:#666">.</span><span style="color:#b44">class</span><span style="color:#666">)</span><span style="color:#666">;</span>
+    
+      <span style="color:#a2f;font-weight:bold">private</span> AccessMgr accessManager<span style="color:#666">;</span>
+      <span style="color:#a2f;font-weight:bold">private</span> JAXBContext jaxbContext<span style="color:#666">;</span>
+      <span style="color:#a2f;font-weight:bold">private</span> Marshaller marshaller<span style="color:#666">;</span>
+    
+      <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#00a000">IamAuthenticationHandler</span><span style="color:#666">(</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+        <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+          jaxbContext <span style="color:#666">=</span> JAXBContext<span style="color:#666">.</span><span style="color:#b44">newInstance</span><span style="color:#666">(</span>Session<span style="color:#666">.</span><span style="color:#b44">class</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          marshaller <span style="color:#666">=</span> jaxbContext<span style="color:#666">.</span><span style="color:#b44">createMarshaller</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>JAXBException e<span style="color:#666">)</span> <span style="color:#666">{</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">error</span><span style="color:#666">(</span><span style="color:#b44">&#34;cannot bind Session with jaxb context&#34;</span><span style="color:#666">,</span> e<span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span>
+      <span style="color:#666">}</span>
+    
+      <span style="color:#a2f">@Override</span>
+      <span style="color:#a2f;font-weight:bold">protected</span> HandlerResult <span style="color:#00a000">authenticateUsernamePasswordInternal</span><span style="color:#666">(</span>
+          UsernamePasswordCredential usernamePasswordCredential<span style="color:#666">)</span>
+              <span style="color:#a2f;font-weight:bold">throws</span> GeneralSecurityException<span style="color:#666">,</span> PreventedException <span style="color:#666">{</span>
+        String username <span style="color:#666">=</span> usernamePasswordCredential<span style="color:#666">.</span><span style="color:#b44">getUsername</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        String password <span style="color:#666">=</span> usernamePasswordCredential<span style="color:#666">.</span><span style="color:#b44">getPassword</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        Session iamSession <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">;</span>
+        String iamXmlSession <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">;</span>
+        <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span><span style="color:#b44">&#34;trying to authenticate username : {}, password : {}&#34;</span><span style="color:#666">,</span>
+              <span style="color:#a2f;font-weight:bold">new</span> Object<span style="color:#666">[</span><span style="color:#666">]</span> <span style="color:#666">{</span>username<span style="color:#666">,</span> password<span style="color:#666">}</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          iamSession <span style="color:#666">=</span> accessManager<span style="color:#666">.</span><span style="color:#b44">createSession</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> User<span style="color:#666">(</span>username<span style="color:#666">,</span> password<span style="color:#666">.</span><span style="color:#b44">toCharArray</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</spa [...]
+          LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span><span style="color:#b44">&#34;iam session : {}&#34;</span><span style="color:#666">,</span> iamSession<span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>iamSession <span style="color:#666">!</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+            StringWriter writer <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> StringWriter<span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+            marshaller<span style="color:#666">.</span><span style="color:#b44">marshal</span><span style="color:#666">(</span>iamSession<span style="color:#666">,</span> writer<span style="color:#666">)</span><span style="color:#666">;</span>
+            iamXmlSession <span style="color:#666">=</span> writer<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+            LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span><span style="color:#b44">&#34;iam xml session : {}&#34;</span><span style="color:#666">,</span> iamXmlSession<span style="color:#666">)</span><span style="color:#666">;</span>
+            Map<span style="color:#666">&lt;</span>String<span style="color:#666">,</span> Object<span style="color:#666">&gt;</span> attributes <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> HashMap<span style="color:#666">&lt;</span><span style="color:#666">&gt;</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+            attributes<span style="color:#666">.</span><span style="color:#b44">put</span><span style="color:#666">(</span><span style="color:#b44">&#34;iamSession&#34;</span><span style="color:#666">,</span> iamXmlSession<span style="color:#666">)</span><span style="color:#666">;</span>
+            <span style="color:#a2f;font-weight:bold">return</span> createHandlerResult<span style="color:#666">(</span>usernamePasswordCredential<span style="color:#666">,</span>
+                principalFactory<span style="color:#666">.</span><span style="color:#b44">createPrincipal</span><span style="color:#666">(</span>username<span style="color:#666">,</span> attributes<span style="color:#666">)</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#666">}</span>
+        <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>org<span style="color:#666">.</span><span style="color:#b44">apache</span><span style="color:#666">.</span><span style="color:#b44">directory</span><span style="color:#666">.</span><span style="color:#b44">fortress</span><span style="color:#666">.</span><span style="color:#b44">core</span><span style="color:#666">.</span><span style="color:#b44">SecurityExcept [...]
+          String errorMessage <span style="color:#666">=</span> <span style="color:#b44">&#34;IAM authentication failed for [&#34;</span> <span style="color:#666">+</span> username <span style="color:#666">+</span> <span style="color:#b44">&#34;]&#34;</span><span style="color:#666">;</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span>errorMessage<span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#a2f;font-weight:bold">throw</span> <span style="color:#a2f;font-weight:bold">new</span> GeneralSecurityException<span style="color:#666">(</span>errorMessage<span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>JAXBException e<span style="color:#666">)</span> <span style="color:#666">{</span>
+          String errorMessage <span style="color:#666">=</span> <span style="color:#b44">&#34;cannot marshalling session with value : &#34;</span> <span style="color:#666">+</span> iamSession <span style="color:#666">=</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span> <span style="color:#666">?</span> <span style="color:#b44">&#34;null&#34;</span>
+              <span style="color:#666">:</span> iamSession<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span>errorMessage<span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#a2f;font-weight:bold">throw</span> <span style="color:#a2f;font-weight:bold">new</span> GeneralSecurityException<span style="color:#666">(</span>errorMessage<span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span>
+        LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span><span style="color:#b44">&#34;returning default handler&#34;</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#a2f;font-weight:bold">return</span> createHandlerResult<span style="color:#666">(</span>usernamePasswordCredential<span style="color:#666">,</span>
+            principalFactory<span style="color:#666">.</span><span style="color:#b44">createPrincipal</span><span style="color:#666">(</span>username<span style="color:#666">)</span><span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span><span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+    
+      <span style="color:#a2f;font-weight:bold">public</span> AccessMgr <span style="color:#00a000">getAccessManager</span><span style="color:#666">(</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+        <span style="color:#a2f;font-weight:bold">return</span> accessManager<span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+    
+      <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">void</span> <span style="color:#00a000">setAccessManager</span><span style="color:#666">(</span>AccessMgr accessManager<span style="color:#666">)</span> <span style="color:#666">{</span>
+        <span style="color:#a2f;font-weight:bold">this</span><span style="color:#666">.</span><span style="color:#b44">accessManager</span> <span style="color:#666">=</span> accessManager<span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+    
+    <span style="color:#666">}</span>
+</code></pre></div><p>In the above source code you can see how I construct a new principal by creating a new attribute map with values contained withing the <em>Apache Fortress</em> Session xml.</p>
 <h4 id="2-the-attribute-populator">2. The Attribute Populator</h4>
 <p>In order to populate fortress and pass it on to the client we need to override the <em>casServiceValidationSuccess.jsp</em> file, located at <em>WEB-INF/view/jsp/protocol/2.0/</em>, since its default view won&rsquo;t populating the necessary attributes. Here is how I was able to accomplish that:</p>
-<pre><code>:::XML
-
-&lt;%@ page session=&quot;false&quot; contentType=&quot;application/xml; charset=UTF-8&quot; %&gt;
-&lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %&gt;
-&lt;%@ taglib uri=&quot;http://java.sun.com/jsp/jstl/functions&quot; prefix=&quot;fn&quot; %&gt;
-&lt;cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'&gt;
-    &lt;!-- cas 2 validation success --&gt;
-    &lt;cas:authenticationSuccess&gt;
-        &lt;cas:user&gt;${fn:escapeXml(assertion.primaryAuthentication.principal.id)}&lt;/cas:user&gt;
-        &lt;c:if test=&quot;${not empty assertion.primaryAuthentication.principal.attributes}&quot;&gt;
-        &lt;cas:attributes&gt;
-            &lt;c:forEach var=&quot;attr&quot; items=&quot;${assertion.primaryAuthentication.principal.attributes}&quot; &gt;
-                &lt;cas:${fn:escapeXml(attr.key)}&gt;&lt;![CDATA[${attr.value}]]&gt;&lt;/cas:${fn:escapeXml(attr.key)}&gt;
-            &lt;/c:forEach&gt;
-        &lt;/cas:attributes&gt;
-        &lt;/c:if&gt;
-        &lt;c:if test=&quot;${not empty pgtIou}&quot;&gt;
-                &lt;cas:proxyGrantingTicket&gt;${pgtIou}&lt;/cas:proxyGrantingTicket&gt;
-        &lt;/c:if&gt;
-        &lt;c:if test=&quot;${fn:length(assertion.chainedAuthentications) &gt; 1}&quot;&gt;
-          &lt;cas:proxies&gt;
-            &lt;c:forEach var=&quot;proxy&quot; items=&quot;${assertion.chainedAuthentications}&quot; varStatus=&quot;loopStatus&quot; begin=&quot;0&quot; end=&quot;${fn:length(assertion.chainedAuthentications)-2}&quot; step=&quot;1&quot;&gt;
-                 &lt;cas:proxy&gt;${fn:escapeXml(proxy.principal.id)}&lt;/cas:proxy&gt;
-            &lt;/c:forEach&gt;
-          &lt;/cas:proxies&gt;
-        &lt;/c:if&gt;
-    &lt;/cas:authenticationSuccess&gt;
-&lt;/cas:serviceResponse&gt;
-</code></pre>
-<p>One thing that I love about <strong>CAS</strong>, even if you correctly extracted the attribute at this page (or maybe you just got hacked at this page), <strong>CAS</strong> is able to protect the returned attributes by changing the services registry configuration. see the <em>HTTPSandIMAPS-10000001.json</em> file. I’ve put <em>ReturnAllAttributeReleasePolicy</em> type for debuging all the attributes returned, you can change it later to make your application more secure as well.</p>
+<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-XML" data-lang="XML">    
+    <span style="">&lt;</span>%@ page session=&#34;false&#34; contentType=&#34;application/xml; charset=UTF-8&#34; %&gt;
+    <span style="">&lt;</span>%@ taglib prefix=&#34;c&#34; uri=&#34;http://java.sun.com/jsp/jstl/core&#34; %&gt;
+    <span style="">&lt;</span>%@ taglib uri=&#34;http://java.sun.com/jsp/jstl/functions&#34; prefix=&#34;fn&#34; %&gt;
+    <span style="color:#008000;font-weight:bold">&lt;cas:serviceResponse</span> <span style="color:#b44">xmlns:cas=</span><span style="color:#b44">&#39;http://www.yale.edu/tp/cas&#39;</span><span style="color:#008000;font-weight:bold">&gt;</span>
+        <span style="color:#080;font-style:italic">&lt;!--</span><span style="color:#080;font-style:italic"> cas 2 validation success </span><span style="color:#080;font-style:italic">--&gt;</span>
+        <span style="color:#008000;font-weight:bold">&lt;cas:authenticationSuccess</span><span style="color:#008000;font-weight:bold">&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;cas:user</span><span style="color:#008000;font-weight:bold">&gt;</span>${fn:escapeXml(assertion.primaryAuthentication.principal.id)}<span style="color:#008000;font-weight:bold">&lt;/cas:user&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;c:if</span> <span style="color:#b44">test=</span><span style="color:#b44">&#34;${not empty assertion.primaryAuthentication.principal.attributes}&#34;</span><span style="color:#008000;font-weight:bold">&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;cas:attributes</span><span style="color:#008000;font-weight:bold">&gt;</span>
+                <span style="color:#008000;font-weight:bold">&lt;c:forEach</span> <span style="color:#b44">var=</span><span style="color:#b44">&#34;attr&#34;</span> <span style="color:#b44">items=</span><span style="color:#b44">&#34;${assertion.primaryAuthentication.principal.attributes}&#34;</span> <span style="color:#008000;font-weight:bold">&gt;</span>
+                    <span style="color:#008000;font-weight:bold">&lt;cas:</span><span style="">$</span><span style="">{</span><span style="">f</span><span style="">n</span><span style="">:</span><span style="">e</span><span style="">s</span><span style="">c</span><span style="">a</span><span style="">p</span><span style="">e</span><span style="">X</span><span style="">m</span><span style="">l</span><span style="">(</span><span style="">a</span><span style="">t</span><span style="">t</spa [...]
+                <span style="color:#008000;font-weight:bold">&lt;/c:forEach&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;/cas:attributes&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;/c:if&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;c:if</span> <span style="color:#b44">test=</span><span style="color:#b44">&#34;${not empty pgtIou}&#34;</span><span style="color:#008000;font-weight:bold">&gt;</span>
+                    <span style="color:#008000;font-weight:bold">&lt;cas:proxyGrantingTicket</span><span style="color:#008000;font-weight:bold">&gt;</span>${pgtIou}<span style="color:#008000;font-weight:bold">&lt;/cas:proxyGrantingTicket&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;/c:if&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;c:if</span> <span style="color:#b44">test=</span><span style="color:#b44">&#34;${fn:length(assertion.chainedAuthentications) &gt; 1}&#34;</span><span style="color:#008000;font-weight:bold">&gt;</span>
+              <span style="color:#008000;font-weight:bold">&lt;cas:proxies</span><span style="color:#008000;font-weight:bold">&gt;</span>
+                <span style="color:#008000;font-weight:bold">&lt;c:forEach</span> <span style="color:#b44">var=</span><span style="color:#b44">&#34;proxy&#34;</span> <span style="color:#b44">items=</span><span style="color:#b44">&#34;${assertion.chainedAuthentications}&#34;</span> <span style="color:#b44">varStatus=</span><span style="color:#b44">&#34;loopStatus&#34;</span> <span style="color:#b44">begin=</span><span style="color:#b44">&#34;0&#34;</span> <span style="color:#b44">end=</sp [...]
+                     <span style="color:#008000;font-weight:bold">&lt;cas:proxy</span><span style="color:#008000;font-weight:bold">&gt;</span>${fn:escapeXml(proxy.principal.id)}<span style="color:#008000;font-weight:bold">&lt;/cas:proxy&gt;</span>
+                <span style="color:#008000;font-weight:bold">&lt;/c:forEach&gt;</span>
+              <span style="color:#008000;font-weight:bold">&lt;/cas:proxies&gt;</span>
+            <span style="color:#008000;font-weight:bold">&lt;/c:if&gt;</span>
+        <span style="color:#008000;font-weight:bold">&lt;/cas:authenticationSuccess&gt;</span>
+    <span style="color:#008000;font-weight:bold">&lt;/cas:serviceResponse&gt;</span>
+</code></pre></div><p>One thing that I love about <strong>CAS</strong>, even if you correctly extracted the attribute at this page (or maybe you just got hacked at this page), <strong>CAS</strong> is able to protect the returned attributes by changing the services registry configuration. see the <em>HTTPSandIMAPS-10000001.json</em> file. I’ve put <em>ReturnAllAttributeReleasePolicy</em> type for debuging all the attributes returned, you can change it later to make your application more s [...]
 <h4 id="3-apache-ignite-for-ticket-replication">3. Apache Ignite For Ticket Replication</h4>
 <p>To have a production readiness we need to somehow manage a high availability requirement, so we&rsquo;re not just using a single <strong>CAS</strong> server. That is why we needed to have a centralized or distributed ticket repository, to allow <strong>CAS</strong> to scale. To scale the ticket repository, I chose <a href="https://ignite.apache.org/">Apache Ignite</a> for distributing the tickets. To Implement is very simple, and is also written about in <a href="https://www.apereo.or [...]
 <h3 id="client-side-development">Client side development:</h3>
 <h4 id="1-the-spring-voter">1. The Spring Voter</h4>
 <p><strong>Spring</strong> is a great framework, they allow you to add your own interceptors to use your own implementation. <em>WebExpressionVoter</em> is the class you need to extend in order to override the normal spring decision mechanism.  Usually you will use xml + regex for registering the condition. However, xml + regex is not the approach I wanted for my development team. See below code snippet, to understand what I did to make this more dynamic.</p>
-<pre><code>:::Java
-  @Override
-  @SuppressWarnings(&quot;static-access&quot;)
-  public int vote(Authentication authentication, FilterInvocation fi,
-      Collection&lt;ConfigAttribute&gt; attributes) {
-    Authentication securityContextAuthentication =
-        SecurityContextHolder.getContext().getAuthentication();
-    int result = super.vote(securityContextAuthentication, fi, attributes);
-    if (System.getenv(IAM_SECURITY_PARAMETER) != null) {
-      LOG.warn(&quot;iam security is disable, enable all access mode is enable&quot;);
-      return result;
-    } else {
-      LOG.debug(&quot;authentication = {}&quot;,
-          ToStringBuilder.reflectionToString(securityContextAuthentication));
-      LOG.debug(&quot;super vote for : {}&quot;, result);
-      if (super.ACCESS_GRANTED == result) {
-        String requestMethod = fi.getRequest().getMethod().toLowerCase();
-        String filterUrl = getFilterUrl(fi.getHttpRequest());
-        if (filterUrl == null) {
-          return result;
-        }
-        try {
-          CasAuthenticationToken casAuthenticationToken =
-              ((CasAuthenticationToken) securityContextAuthentication);
-          LOG.debug(&quot;assertion : {}&quot;,
-              ToStringBuilder.reflectionToString(casAuthenticationToken.getAssertion()));
-          String iamSessionXml = (String) casAuthenticationToken.getAssertion().getAttributes()
-              .get(IAM_SESSION_ATTRIBUTE_KEY);
-          LOG.debug(&quot;iam session xml == {}&quot;, iamSessionXml);
-          Session iamSession = sessionCache.getIfPresent(casAuthenticationToken.getKeyHash());
-          if (iamSession == null) {
-            Unmarshaller unmarshaller = null;
-            try {
-              unmarshaller = context.createUnmarshaller();
-            } catch (JAXBException ex) {
-              LOG.warn(&quot;cannot create unmarshaller : &quot;, ex);
-            }
-            iamSession = (Session) unmarshaller.unmarshal(new StringReader(iamSessionXml));
-            sessionCache.put(casAuthenticationToken.getKeyHash(), iamSession);
-          }
-          StringBuilder sessionPermissionKeyBuilder = new StringBuilder(iamSession.getSessionId()).append(filterUrl).append(requestMethod);
-          Boolean isAllowed = accessCache.getIfPresent(sessionPermissionKeyBuilder.toString());
-          if(isAllowed == null) {
-            isAllowed = accessManager.checkAccess(iamSession, new Permission(filterUrl, requestMethod));
-            accessCache.put(sessionPermissionKeyBuilder.toString(), isAllowed);
-          }
-          LOG.debug(&quot;{} is {} to access {} with method {}&quot;,
-              new Object[] {securityContextAuthentication.getName(),
-                  isAllowed ? &quot;granted&quot; : &quot;denied&quot;, filterUrl, requestMethod});
-          if (isAllowed) {
-            return super.ACCESS_GRANTED;
-          }
-        } catch (Exception e) {
-          LOG.error(&quot;catch exception when communicate with iam server&quot;, e);
-        }
-      }
-      return super.ACCESS_DENIED;
-    }
-  }
-</code></pre>
-<p>Yep, I&rsquo;m calling fortress to check if the user is allowed to access fortress permissions or not.</p>
+<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-Java" data-lang="Java">      <span style="color:#a2f">@Override</span>
+      <span style="color:#a2f">@SuppressWarnings</span><span style="color:#666">(</span><span style="color:#b44">&#34;static-access&#34;</span><span style="color:#666">)</span>
+      <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">int</span> <span style="color:#00a000">vote</span><span style="color:#666">(</span>Authentication authentication<span style="color:#666">,</span> FilterInvocation fi<span style="color:#666">,</span>
+          Collection<span style="color:#666">&lt;</span>ConfigAttribute<span style="color:#666">&gt;</span> attributes<span style="color:#666">)</span> <span style="color:#666">{</span>
+        Authentication securityContextAuthentication <span style="color:#666">=</span>
+            SecurityContextHolder<span style="color:#666">.</span><span style="color:#b44">getContext</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">getAuthentication</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#0b0;font-weight:bold">int</span> result <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">super</span><span style="color:#666">.</span><span style="color:#b44">vote</span><span style="color:#666">(</span>securityContextAuthentication<span style="color:#666">,</span> fi<span style="color:#666">,</span> attributes<span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>System<span style="color:#666">.</span><span style="color:#b44">getenv</span><span style="color:#666">(</span>IAM_SECURITY_PARAMETER<span style="color:#666">)</span> <span style="color:#666">!</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">warn</span><span style="color:#666">(</span><span style="color:#b44">&#34;iam security is disable, enable all access mode is enable&#34;</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#a2f;font-weight:bold">return</span> result<span style="color:#666">;</span>
+        <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">else</span> <span style="color:#666">{</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;authentication = {}&#34;</span><span style="color:#666">,</span>
+              ToStringBuilder<span style="color:#666">.</span><span style="color:#b44">reflectionToString</span><span style="color:#666">(</span>securityContextAuthentication<span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;super vote for : {}&#34;</span><span style="color:#666">,</span> result<span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">super</span><span style="color:#666">.</span><span style="color:#b44">ACCESS_GRANTED</span> <span style="color:#666">=</span><span style="color:#666">=</span> result<span style="color:#666">)</span> <span style="color:#666">{</span>
+            String requestMethod <span style="color:#666">=</span> fi<span style="color:#666">.</span><span style="color:#b44">getRequest</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">getMethod</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">toLowerCase</span><span style="color:#666">(</span><span style="color:#666">)</span> [...]
+            String filterUrl <span style="color:#666">=</span> getFilterUrl<span style="color:#666">(</span>fi<span style="color:#666">.</span><span style="color:#b44">getHttpRequest</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+            <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>filterUrl <span style="color:#666">=</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+              <span style="color:#a2f;font-weight:bold">return</span> result<span style="color:#666">;</span>
+            <span style="color:#666">}</span>
+            <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+              CasAuthenticationToken casAuthenticationToken <span style="color:#666">=</span>
+                  <span style="color:#666">(</span><span style="color:#666">(</span>CasAuthenticationToken<span style="color:#666">)</span> securityContextAuthentication<span style="color:#666">)</span><span style="color:#666">;</span>
+              LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;assertion : {}&#34;</span><span style="color:#666">,</span>
+                  ToStringBuilder<span style="color:#666">.</span><span style="color:#b44">reflectionToString</span><span style="color:#666">(</span>casAuthenticationToken<span style="color:#666">.</span><span style="color:#b44">getAssertion</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+              String iamSessionXml <span style="color:#666">=</span> <span style="color:#666">(</span>String<span style="color:#666">)</span> casAuthenticationToken<span style="color:#666">.</span><span style="color:#b44">getAssertion</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">getAttributes</span><span style="color:#666">(</span><span style="color:#666">)</span>
+                  <span style="color:#666">.</span><span style="color:#b44">get</span><span style="color:#666">(</span>IAM_SESSION_ATTRIBUTE_KEY<span style="color:#666">)</span><span style="color:#666">;</span>
+              LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;iam session xml == {}&#34;</span><span style="color:#666">,</span> iamSessionXml<span style="color:#666">)</span><span style="color:#666">;</span>
+              Session iamSession <span style="color:#666">=</span> sessionCache<span style="color:#666">.</span><span style="color:#b44">getIfPresent</span><span style="color:#666">(</span>casAuthenticationToken<span style="color:#666">.</span><span style="color:#b44">getKeyHash</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+              <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>iamSession <span style="color:#666">=</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+                Unmarshaller unmarshaller <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">;</span>
+                <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+                  unmarshaller <span style="color:#666">=</span> context<span style="color:#666">.</span><span style="color:#b44">createUnmarshaller</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+                <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>JAXBException ex<span style="color:#666">)</span> <span style="color:#666">{</span>
+                  LOG<span style="color:#666">.</span><span style="color:#b44">warn</span><span style="color:#666">(</span><span style="color:#b44">&#34;cannot create unmarshaller : &#34;</span><span style="color:#666">,</span> ex<span style="color:#666">)</span><span style="color:#666">;</span>
+                <span style="color:#666">}</span>
+                iamSession <span style="color:#666">=</span> <span style="color:#666">(</span>Session<span style="color:#666">)</span> unmarshaller<span style="color:#666">.</span><span style="color:#b44">unmarshal</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> StringReader<span style="color:#666">(</span>iamSessionXml<span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+                sessionCache<span style="color:#666">.</span><span style="color:#b44">put</span><span style="color:#666">(</span>casAuthenticationToken<span style="color:#666">.</span><span style="color:#b44">getKeyHash</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">,</span> iamSession<span style="color:#666">)</span><span style="color:#666">;</span>
+              <span style="color:#666">}</span>
+              StringBuilder sessionPermissionKeyBuilder <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> StringBuilder<span style="color:#666">(</span>iamSession<span style="color:#666">.</span><span style="color:#b44">getSessionId</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">append</span><span style="color:#666">(</span>filterUrl<spa [...]
+              Boolean isAllowed <span style="color:#666">=</span> accessCache<span style="color:#666">.</span><span style="color:#b44">getIfPresent</span><span style="color:#666">(</span>sessionPermissionKeyBuilder<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+              <span style="color:#a2f;font-weight:bold">if</span><span style="color:#666">(</span>isAllowed <span style="color:#666">=</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+                isAllowed <span style="color:#666">=</span> accessManager<span style="color:#666">.</span><span style="color:#b44">checkAccess</span><span style="color:#666">(</span>iamSession<span style="color:#666">,</span> <span style="color:#a2f;font-weight:bold">new</span> Permission<span style="color:#666">(</span>filterUrl<span style="color:#666">,</span> requestMethod<span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+                accessCache<span style="color:#666">.</span><span style="color:#b44">put</span><span style="color:#666">(</span>sessionPermissionKeyBuilder<span style="color:#666">.</span><span style="color:#b44">toString</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">,</span> isAllowed<span style="color:#666">)</span><span style="color:#666">;</span>
+              <span style="color:#666">}</span>
+              LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;{} is {} to access {} with method {}&#34;</span><span style="color:#666">,</span>
+                  <span style="color:#a2f;font-weight:bold">new</span> Object<span style="color:#666">[</span><span style="color:#666">]</span> <span style="color:#666">{</span>securityContextAuthentication<span style="color:#666">.</span><span style="color:#b44">getName</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">,</span>
+                      isAllowed <span style="color:#666">?</span> <span style="color:#b44">&#34;granted&#34;</span> <span style="color:#666">:</span> <span style="color:#b44">&#34;denied&#34;</span><span style="color:#666">,</span> filterUrl<span style="color:#666">,</span> requestMethod<span style="color:#666">}</span><span style="color:#666">)</span><span style="color:#666">;</span>
+              <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>isAllowed<span style="color:#666">)</span> <span style="color:#666">{</span>
+                <span style="color:#a2f;font-weight:bold">return</span> <span style="color:#a2f;font-weight:bold">super</span><span style="color:#666">.</span><span style="color:#b44">ACCESS_GRANTED</span><span style="color:#666">;</span>
+              <span style="color:#666">}</span>
+            <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>Exception e<span style="color:#666">)</span> <span style="color:#666">{</span>
+              LOG<span style="color:#666">.</span><span style="color:#b44">error</span><span style="color:#666">(</span><span style="color:#b44">&#34;catch exception when communicate with iam server&#34;</span><span style="color:#666">,</span> e<span style="color:#666">)</span><span style="color:#666">;</span>
+            <span style="color:#666">}</span>
+          <span style="color:#666">}</span>
+          <span style="color:#a2f;font-weight:bold">return</span> <span style="color:#a2f;font-weight:bold">super</span><span style="color:#666">.</span><span style="color:#b44">ACCESS_DENIED</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span>
+      <span style="color:#666">}</span>
+</code></pre></div><p>Yep, I&rsquo;m calling fortress to check if the user is allowed to access fortress permissions or not.</p>
 <h5 id="2-userdetail-populator">2. UserDetail Populator</h5>
 <p>Spring uses the implementation of <em>AbstractCasAssertionUserDetailsService</em> to populate user details following successful authentication, you can see the example at <em>IamUserDetails</em> code, here is the snipet of that class:</p>
-<pre><code>:::Java
-@Override
-  protected UserDetails loadUserDetails(final Assertion assertion) {
-    List&lt;GrantedAuthority&gt; grantedAuthorities = new ArrayList&lt;&gt;();
-    LOG.debug(&quot;user asssertion : {}&quot;, ToStringBuilder.reflectionToString(assertion));
-    boolean accountNonExpired = true;
-    boolean credentialsNonExpired = true;
-    boolean accountNonLocked = true;
-    boolean enabled = true;
-    for (String attribute : this.attributes) {
-      String value = (String) assertion.getPrincipal().getAttributes().get(attribute);
-      LOG.debug(&quot;value = {}&quot;, value);
-      if (value != null) {
-        LOG.debug(&quot;adding default authorization to user&quot;);
-    grantedAuthorities.add(new SimpleGrantedAuthority(ROLE_USER));    
-
-        Unmarshaller unmarshaller = null;    
-        Session iamSession = null;
-        try {
-          unmarshaller = context.createUnmarshaller();
-          iamSession = (Session) unmarshaller.unmarshal(new StringReader(value));
-          for (UserRole role : iamSession.getRoles()) {
-            LOG.debug(&quot;adding {} authorization to user&quot;, role.getName().toUpperCase());
-            grantedAuthorities.add(new SimpleGrantedAuthority(role.getName().toUpperCase()));
-          }
-        } catch (Exception ex) {
-          LOG.error(&quot;cannot generate user details&quot;, ex);
-        }
-      }
-    }
-    LOG.debug(
-        &quot;accountNonExpired : {}, credentialsNonExpired : {}, accountNonLocked : {}, enabled : {}&quot;,
-        new Object[] {accountNonExpired, credentialsNonExpired, accountNonLocked, enabled});
-    return new User(assertion.getPrincipal().getName().toLowerCase().trim(), NON_EXISTENT_PASSWORD_VALUE, enabled,
-        accountNonExpired, credentialsNonExpired, accountNonLocked, grantedAuthorities);
-  }
-</code></pre>
-<p>You can change the implementation later for your needs.</p>
+<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-Java" data-lang="Java">    <span style="color:#a2f">@Override</span>
+      <span style="color:#a2f;font-weight:bold">protected</span> UserDetails <span style="color:#00a000">loadUserDetails</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">final</span> Assertion assertion<span style="color:#666">)</span> <span style="color:#666">{</span>
+        List<span style="color:#666">&lt;</span>GrantedAuthority<span style="color:#666">&gt;</span> grantedAuthorities <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">new</span> ArrayList<span style="color:#666">&lt;</span><span style="color:#666">&gt;</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;user asssertion : {}&#34;</span><span style="color:#666">,</span> ToStringBuilder<span style="color:#666">.</span><span style="color:#b44">reflectionToString</span><span style="color:#666">(</span>assertion<span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#0b0;font-weight:bold">boolean</span> accountNonExpired <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">;</span>
+        <span style="color:#0b0;font-weight:bold">boolean</span> credentialsNonExpired <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">;</span>
+        <span style="color:#0b0;font-weight:bold">boolean</span> accountNonLocked <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">;</span>
+        <span style="color:#0b0;font-weight:bold">boolean</span> enabled <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">true</span><span style="color:#666">;</span>
+        <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>String attribute <span style="color:#666">:</span> <span style="color:#a2f;font-weight:bold">this</span><span style="color:#666">.</span><span style="color:#b44">attributes</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+          String value <span style="color:#666">=</span> <span style="color:#666">(</span>String<span style="color:#666">)</span> assertion<span style="color:#666">.</span><span style="color:#b44">getPrincipal</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">getAttributes</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">get</spa [...]
+          LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;value = {}&#34;</span><span style="color:#666">,</span> value<span style="color:#666">)</span><span style="color:#666">;</span>
+          <span style="color:#a2f;font-weight:bold">if</span> <span style="color:#666">(</span>value <span style="color:#666">!</span><span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+            LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;adding default authorization to user&#34;</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        grantedAuthorities<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> SimpleGrantedAuthority<span style="color:#666">(</span>ROLE_USER<span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>    
+
+            Unmarshaller unmarshaller <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">;</span>    
+            Session iamSession <span style="color:#666">=</span> <span style="color:#a2f;font-weight:bold">null</span><span style="color:#666">;</span>
+            <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+              unmarshaller <span style="color:#666">=</span> context<span style="color:#666">.</span><span style="color:#b44">createUnmarshaller</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">;</span>
+              iamSession <span style="color:#666">=</span> <span style="color:#666">(</span>Session<span style="color:#666">)</span> unmarshaller<span style="color:#666">.</span><span style="color:#b44">unmarshal</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> StringReader<span style="color:#666">(</span>value<span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+              <span style="color:#a2f;font-weight:bold">for</span> <span style="color:#666">(</span>UserRole role <span style="color:#666">:</span> iamSession<span style="color:#666">.</span><span style="color:#b44">getRoles</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+                LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span><span style="color:#b44">&#34;adding {} authorization to user&#34;</span><span style="color:#666">,</span> role<span style="color:#666">.</span><span style="color:#b44">getName</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">toUpperCase</span><span style="color:#666">(</span><span style= [...]
+                grantedAuthorities<span style="color:#666">.</span><span style="color:#b44">add</span><span style="color:#666">(</span><span style="color:#a2f;font-weight:bold">new</span> SimpleGrantedAuthority<span style="color:#666">(</span>role<span style="color:#666">.</span><span style="color:#b44">getName</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">toUpperCase</span><span style="color:#666">(</spa [...]
+              <span style="color:#666">}</span>
+            <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>Exception ex<span style="color:#666">)</span> <span style="color:#666">{</span>
+              LOG<span style="color:#666">.</span><span style="color:#b44">error</span><span style="color:#666">(</span><span style="color:#b44">&#34;cannot generate user details&#34;</span><span style="color:#666">,</span> ex<span style="color:#666">)</span><span style="color:#666">;</span>
+            <span style="color:#666">}</span>
+          <span style="color:#666">}</span>
+        <span style="color:#666">}</span>
+        LOG<span style="color:#666">.</span><span style="color:#b44">debug</span><span style="color:#666">(</span>
+            <span style="color:#b44">&#34;accountNonExpired : {}, credentialsNonExpired : {}, accountNonLocked : {}, enabled : {}&#34;</span><span style="color:#666">,</span>
+            <span style="color:#a2f;font-weight:bold">new</span> Object<span style="color:#666">[</span><span style="color:#666">]</span> <span style="color:#666">{</span>accountNonExpired<span style="color:#666">,</span> credentialsNonExpired<span style="color:#666">,</span> accountNonLocked<span style="color:#666">,</span> enabled<span style="color:#666">}</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#a2f;font-weight:bold">return</span> <span style="color:#a2f;font-weight:bold">new</span> User<span style="color:#666">(</span>assertion<span style="color:#666">.</span><span style="color:#b44">getPrincipal</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="color:#b44">getName</span><span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">.</span><span style="co [...]
+            accountNonExpired<span style="color:#666">,</span> credentialsNonExpired<span style="color:#666">,</span> accountNonLocked<span style="color:#666">,</span> grantedAuthorities<span style="color:#666">)</span><span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+</code></pre></div><p>You can change the implementation later for your needs.</p>
 <h5 id="3-network-might-be-a-problem">3. Network Might Be a Problem</h5>
 <p>Since this is running inside a production environment, we needed to consider that sometimes there might be a trouble over our network that causes problems and requires retries. That is why it&rsquo;s important to allow a little delay time in our application.  Here&rsquo;s an example of how allow a small delay, in order to allow temporary network glitches and slowdowns to work themselves out.</p>
-<pre><code>:::Java
-/*
- * Copyright 2017 to PT. Global Digital Niaga(Blibli.com)
- * 
- * Licensed under the Apache License, Version 2.0; you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.gdn.iam.spring.security;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.security.cas.authentication.CasAuthenticationProvider;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
-
-public class GdnCasAuthenticationProvider extends CasAuthenticationProvider {
-
-  private static transient Logger LOG = LoggerFactory.getLogger(GdnCasAuthenticationProvider.class);
-  private long sleepForDistributeTicketTime = 300;
-
-  @Override
-  public Authentication authenticate(Authentication authentication) throws AuthenticationException {
-    try {
-      LOG.trace(
-          &quot;will try to sleep for waiting ticket to be distributed to other node, sleep time : {}&quot;,
-          getSleepForDistributeTicketTime());
-      Thread.sleep(getSleepForDistributeTicketTime());
-    } catch (InterruptedException e) {
-      LOG.error(&quot;something wrong when sleeping&quot;, e);
-    }
-    return super.authenticate(authentication);
-  }
-
-  public long getSleepForDistributeTicketTime() {
-    return sleepForDistributeTicketTime;
-  }
-
-  public void setSleepForDistributeTicketTime(long sleepForDistributeTicketTime) {
-    this.sleepForDistributeTicketTime = sleepForDistributeTicketTime;
-  }
-
-}
-</code></pre>
-<h3 id="descriptions-of-authentication-flow">Descriptions of authentication flow</h3>
+<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-Java" data-lang="Java">    <span style="color:#080;font-style:italic">/*
+</span><span style="color:#080;font-style:italic">     * Copyright 2017 to PT. Global Digital Niaga(Blibli.com)
+</span><span style="color:#080;font-style:italic">     * 
+</span><span style="color:#080;font-style:italic">     * Licensed under the Apache License, Version 2.0; you may not use this file except in compliance
+</span><span style="color:#080;font-style:italic">     * with the License. You may obtain a copy of the License at
+</span><span style="color:#080;font-style:italic">     * 
+</span><span style="color:#080;font-style:italic">     * http://www.apache.org/licenses/LICENSE-2.0
+</span><span style="color:#080;font-style:italic">     * 
+</span><span style="color:#080;font-style:italic">     * Unless required by applicable law or agreed to in writing, software distributed under the License
+</span><span style="color:#080;font-style:italic">     * is distributed on an &#34;AS IS&#34; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+</span><span style="color:#080;font-style:italic">     * or implied. See the License for the specific language governing permissions and limitations under
+</span><span style="color:#080;font-style:italic">     * the License.
+</span><span style="color:#080;font-style:italic">     */</span>
+    <span style="color:#a2f;font-weight:bold">package</span> <span style="color:#00f;font-weight:bold">com.gdn.iam.spring.security</span><span style="color:#666">;</span>
+    
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.slf4j.Logger</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.slf4j.LoggerFactory</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.springframework.security.cas.authentication.CasAuthenticationProvider</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.springframework.security.core.Authentication</span><span style="color:#666">;</span>
+    <span style="color:#a2f;font-weight:bold">import</span> <span style="color:#00f;font-weight:bold">org.springframework.security.core.AuthenticationException</span><span style="color:#666">;</span>
+    
+    <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#a2f;font-weight:bold">class</span> <span style="color:#00f">GdnCasAuthenticationProvider</span> <span style="color:#a2f;font-weight:bold">extends</span> CasAuthenticationProvider <span style="color:#666">{</span>
+    
+      <span style="color:#a2f;font-weight:bold">private</span> <span style="color:#a2f;font-weight:bold">static</span> <span style="color:#a2f;font-weight:bold">transient</span> Logger LOG <span style="color:#666">=</span> LoggerFactory<span style="color:#666">.</span><span style="color:#b44">getLogger</span><span style="color:#666">(</span>GdnCasAuthenticationProvider<span style="color:#666">.</span><span style="color:#b44">class</span><span style="color:#666">)</span><span style="color [...]
+      <span style="color:#a2f;font-weight:bold">private</span> <span style="color:#0b0;font-weight:bold">long</span> sleepForDistributeTicketTime <span style="color:#666">=</span> 300<span style="color:#666">;</span>
+    
+      <span style="color:#a2f">@Override</span>
+      <span style="color:#a2f;font-weight:bold">public</span> Authentication <span style="color:#00a000">authenticate</span><span style="color:#666">(</span>Authentication authentication<span style="color:#666">)</span> <span style="color:#a2f;font-weight:bold">throws</span> AuthenticationException <span style="color:#666">{</span>
+        <span style="color:#a2f;font-weight:bold">try</span> <span style="color:#666">{</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">trace</span><span style="color:#666">(</span>
+              <span style="color:#b44">&#34;will try to sleep for waiting ticket to be distributed to other node, sleep time : {}&#34;</span><span style="color:#666">,</span>
+              getSleepForDistributeTicketTime<span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+          Thread<span style="color:#666">.</span><span style="color:#b44">sleep</span><span style="color:#666">(</span>getSleepForDistributeTicketTime<span style="color:#666">(</span><span style="color:#666">)</span><span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span> <span style="color:#a2f;font-weight:bold">catch</span> <span style="color:#666">(</span>InterruptedException e<span style="color:#666">)</span> <span style="color:#666">{</span>
+          LOG<span style="color:#666">.</span><span style="color:#b44">error</span><span style="color:#666">(</span><span style="color:#b44">&#34;something wrong when sleeping&#34;</span><span style="color:#666">,</span> e<span style="color:#666">)</span><span style="color:#666">;</span>
+        <span style="color:#666">}</span>
+        <span style="color:#a2f;font-weight:bold">return</span> <span style="color:#a2f;font-weight:bold">super</span><span style="color:#666">.</span><span style="color:#b44">authenticate</span><span style="color:#666">(</span>authentication<span style="color:#666">)</span><span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+    
+      <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">long</span> <span style="color:#00a000">getSleepForDistributeTicketTime</span><span style="color:#666">(</span><span style="color:#666">)</span> <span style="color:#666">{</span>
+        <span style="color:#a2f;font-weight:bold">return</span> sleepForDistributeTicketTime<span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+    
+      <span style="color:#a2f;font-weight:bold">public</span> <span style="color:#0b0;font-weight:bold">void</span> <span style="color:#00a000">setSleepForDistributeTicketTime</span><span style="color:#666">(</span><span style="color:#0b0;font-weight:bold">long</span> sleepForDistributeTicketTime<span style="color:#666">)</span> <span style="color:#666">{</span>
+        <span style="color:#a2f;font-weight:bold">this</span><span style="color:#666">.</span><span style="color:#b44">sleepForDistributeTicketTime</span> <span style="color:#666">=</span> sleepForDistributeTicketTime<span style="color:#666">;</span>
+      <span style="color:#666">}</span>
+    
+    <span style="color:#666">}</span>
+</code></pre></div><h3 id="descriptions-of-authentication-flow">Descriptions of authentication flow</h3>
 <p>The <strong>CAS</strong> authentication flow will be the same, no changes are required in terms of that authentication flow. Furthermore, you can see that flow at <a href="https://www.apereo.org/projects/cas">Apereo CAS</a> 4.2.x documentation page.</p>
 <p>The main difference now is we don&rsquo;t put the ticket registry inside an in-memory database, we put it inside an <a href="https://ignite.apache.org/">Apache Ignite</a> cache, so when other nodes are there it can replicate the ticket between them which increases efficiencies.</p>
 <h3 id="descriptions-of-authorization-flow">Descriptions of authorization flow</h3>
@@ -466,10 +456,8 @@ public class GdnCasAuthenticationProvider extends CasAuthenticationProvider {
 </ul>
 <p>and configure your <strong>Apache Fortress</strong> properly.</p>
 <h5 id="2-clone-the-project-from-link-at-where-to-download-section-below-change-the-configuration-properly-inside-cas-fortress-serverssrcmainresources-folder-and-package-it-using">2. Clone the project from link at <em>Where to download</em> section below, change the configuration properly inside <em>cas-fortress-servers/src/main/resources</em> folder and package it using:</h5>
-<pre><code>:::Maven
-mvn clean package.
-</code></pre>
-<p>Copy the war file from <em>cas-fortress-server/target</em> into the <em>web-container</em> deploy directory.</p>
+<pre><code class="language-Maven" data-lang="Maven">    mvn clean package.
+</code></pre><p>Copy the war file from <em>cas-fortress-server/target</em> into the <em>web-container</em> deploy directory.</p>
 <h5 id="3-start-your-web-container-and-you-get-cas-fortress-integrated">3. Start your web-container and you get CAS fortress integrated.</h5>
 <h4 id="client-section">Client Section</h4>
 <ul>
diff --git a/content/sitemap.xml b/content/sitemap.xml
index 8ca14e9..1942f7e 100644
--- a/content/sitemap.xml
+++ b/content/sitemap.xml
@@ -1784,7 +1784,7 @@
   
   <url>
     <loc>https://directory.apache.org/fortress.html</loc>
-    <lastmod>2021-05-17T09:09:26+02:00</lastmod>
+    <lastmod>2021-05-18T23:33:49+02:00</lastmod>
   </url>
   
   <url>
@@ -2244,7 +2244,7 @@
   
   <url>
     <loc>https://directory.apache.org/fortress/testimonials.html</loc>
-    <lastmod>2021-05-17T09:09:26+02:00</lastmod>
+    <lastmod>2021-05-18T23:33:49+02:00</lastmod>
   </url>
   
   <url>