<div dir="ltr">P.s. slightly offtopic for CDI spec itself, but:<div><br></div><div>A small workaround is to @Inject SecurityContext context; and then:</div><div><br></div><div>MyPrincipal principal = (MyPrincipal ) context.getCallerPrincipal();</div><div><br></div><div>Thinking of it, maybe I can make the getCallerPrincipal() a generic method, so one can do:</div><div><br></div><div>MyPrincipal principal = context.getCallerPrincipal();<br></div><div><br></div><div>Kind regards,</div><div>Arjan Tijms</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 26, 2017 at 4:38 PM, Romain Manni-Bucau <span dir="ltr"><<a href="mailto:rmannibucau@gmail.com" target="_blank">rmannibucau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi John,<div><br></div><div>agree CDI/security integration (mainly through Principal bean) is completely unusable in practise cause Principal type is too simple (name only) and casting is needed in 99.99% of apps. AFAIK It is tracked at <a href="https://issues.jboss.org/browse/CDI-597" target="_blank">https://issues.jboss.org/<wbr>browse/CDI-597</a>.</div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-8242519338601837576gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br><span style="font-size:small">Romain Manni-Bucau</span><br><a href="https://twitter.com/rmannibucau" target="_blank">@rmannibucau</a> | <a href="https://blog-rmannibucau.rhcloud.com" target="_blank">Blog</a> | <a href="http://rmannibucau.wordpress.com" target="_blank">Old Blog</a> | <a href="https://github.com/rmannibucau" target="_blank">Github</a> | <a href="https://www.linkedin.com/in/rmannibucau" target="_blank">LinkedIn</a> | <a href="https://javaeefactory-rmannibucau.rhcloud.com" target="_blank">JavaEE Factory</a></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">2017-04-26 15:54 GMT+02:00 John Ament <span dir="ltr"><<a href="mailto:john.ament@spartasystems.com" target="_blank">john.ament@spartasystems.com</a>></span><wbr>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr">
<div id="m_-8242519338601837576m_846648769999279057divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p>Hey guys</p>
<p><br>
</p>
<p>I raised a bug against the Weld guys, but think its worth an EG discussion. When a Principal object is injected, the only type it has is Principal. It does not retain the actual type used at runtime. This threw me off on some Keycloak integration I'm
working on (in $dayjob). So I was wondering, is this expected from our POV or should it retain the types of the actual runtime instance?</p>
<p><br>
</p>
<p>John</p>
<div id="m_-8242519338601837576m_846648769999279057Signature">
<div id="m_-8242519338601837576m_846648769999279057divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
</div>
</div>
</div>
<hr>
NOTICE: This e-mail message and any attachments may contain confidential, proprietary, and/or privileged information which should be treated accordingly. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this
message, and destroy all physical and electronic copies. Thank you.
</div>
<br></div></div>______________________________<wbr>_________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/license<wbr>s/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/<wbr>licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br></blockquote></div><br></div>