<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 16px; font-family: Calibri, sans-serif; ">
<div>
<div>Stian,</div>
<div><br>
</div>
<div>I have an application deployed on Tomcat 7 using the Tomcat Adapter.</div>
<div>When i'm logged in and I go to a non-secured URL, KeycloakSecurityContext returns null.</div>
<div>I deployed the same application to the Keycloak Standalone Server, there I don't have this problem.</div>
<div><br>
</div>
<div>At Tomcat the code below returns null when called from /movies/, and works when called from /article/</div>
<div>At Keycloak Standalone Server /movies/ and /article/ works fine.</div>
<div>(KeycloakSecurityContext) request.getAttribute(KeycloakSecurityContext.class.getName());</div>
<div><br>
</div>
<div>Why is this happening?</div>
<div><br>
</div>
<div>In my web.xml I have only one security-constraint securing /article/*</div>
<div><br>
</div>
<div>WEB.XML:</div>
<div><security-constraint></div>
<div> <web-resource-collection></div>
<div> <web-resource-name>Articles</web-resource-name></div>
<div> <url-pattern>/article/*</url-pattern></div>
<div> </web-resource-collection></div>
<div> <auth-constraint></div>
<div> <role-name>user</role-name></div>
<div> </auth-constraint></div>
<div></security-constraint></div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div>-- </div>
<div>Leonardo Nunes</div>
</div>
</div>
<hr style="height:1px;color:#C4C4C4;">
<div style="font-family:Arial;color:#848484;font-size:11px;"><i>Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não poderá usar, copiar ou divulgar as informações
nela contidas ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor avise imediatamente o remetente, respondendo o e-mail e em seguida apague-o. Agradecemos sua cooperação.
<br>
<br>
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have
received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation<i></div>
</i></i>
</body>
</html>