Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling getUserPrincipal() in a Web Service returns ANONYMOUS

 
Hugo Garza
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone I'm trying to use plain SSL between my web service and a client application. They are both running in GlassFish 2.1.1 and are each in seperate domains. The client application is itself web application and I have added the JVM option -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as in order to get it to send it's certificate to the WS.

I've done the importing of the certificates into each others trust stores and it all works. The problem is that I need to do some things with the client certificate in the WS, but calling the getUserPrincipal method of the WebServiceContext that I declared earlier always returns ANONYMOUS.

Why is it doing this and how can I get back what's in the certificate.
 
Hugo Garza
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following some advice from another forum post, I tried the following:

but it just returns null.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the client application are you setting the UserPrincipal in the HTTP request?
 
Hugo Garza
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not explicityly, my understanding is that's what the -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as JVM option is for. And the fact that there is actually communication happening tells me that it's working.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!