Access principal name from servlet filter

Etienne Dysli-Metref etienne.dysli-metref at switch.ch
Fri Aug 21 03:14:33 EDT 2015


On 20/08/15 19:42, Cantor, Scott wrote:
> Leaving getting to it out of the way, the principal name in the
> LoginContext in V2 is, like I thought, after the login happens. It's
> the identity a login handler returns as the result of the login
> process.

This v2 filter just does nothing if there is no LoginContext available.
It's not part of a custom external authentication, that particular IdP
uses JAAS. So the filter is probably called too many times, but it
doesn't hurt.

> I'd have to know the specific need for the data to understand the
> best place to point somebody now. The best "single" answer to this
> would be the PRC->SubjectContext->getPrincipalName() but that's only
> there "after" all of the authentication sequence runs.

What I'd like to do is set a cookie containing the username of the
currently logged in user. There is another application on the same
server as the IdP that reads this cookie to display appropriate support
contacts.

I agree it feels rather weird to put this logic into a filter that runs
even before authentication. If now in v3 there is a better place to do
this (flow action? intercept flow?), I'd be happy to use it.

  Etienne

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://shibboleth.net/pipermail/dev/attachments/20150821/50ce68c7/attachment.sig>


More information about the dev mailing list