I'm assuming you're using Policy Agent 2.2?
Please check in your agent property file if the filter mode
(com.sun.identity.agents.config.filter.mode) is set to either
J2EE_POLICY or ALL. Any other mode will not let you get
the REMOTE_USER.
If that doesn't work then you should send an email to
users_at_opensso.dev.java.net so we can continue the
discussion there.
Cheers,
Hubert
On Dec 14, 2009, at 1:54 PM, Paul Sandoz wrote:
> Hi David,
>
> I am CC'ing Hubert who knows way more than I on OpenSSO and may be
> able to help.
>
> Paul.
>
> On Dec 11, 2009, at 10:19 PM, David Donohue wrote:
>
>> Hello,
>> I am having a problem getting user's ID in Jersey.
>> We use OpenSSO agent to enforce security. When OpenSSO is in
>> place, a
>> user must authenticate in order to see a protected web app/page.
>> My Jersey app has been working great without security.
>>
>> When using OpenSSO, a normal Java application can normally retrieve
>> the user's ID by doing this
>> request.getHeader("REMOTE_USER")
>>
>>
>> However this fails in Jersey. I looked at the HTTP Headers passed to
>> the Jersey HttpServletRequest object and find that the header
>> REMOTE_USER is not passed.
>>
>> I tried using SecurityContext like this
>>
>> @GET
>> @Path(XML_SERVICE)
>> @Produces("application/xml")
>> public String searchResultsXml(
>> @Context HttpServletRequest request,
>> @Context SecurityContext securityContext) {
>> Principal principal = securityContext.getUserPrincipal();
>>
>> String userid = null;
>> if (principal != null) {
>> userid = principal.getName();
>> }
>>
>> but again, I do not get the user name.
>>
>> How can I get this to work?
>> Thanks,
>> David Donohue
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
--
Hubert A. Le Van Gong
Identity Architect
Sun microsystems, Inc.
17 Rue Duprey
Grenoble, 38000
France
--------------------------------------------------
email: hubert.levangong_at_sun.COM
tel:+33 4 7663 0935
blog: http://blog.levangong.com/
N 45 11.900'
W 005 44.145'
Elev. 736 ft.