Pergunta

I have a jax-ws/metro 2.2 web service with username authentification running on glassfish 3.1.2. How can I get the name of acutally logged in users?

Foi útil?

Solução

You can obtain the name the user logged in with via WebServiceContext's getUserPrincipal().getName()

See this for potential gotchas.

As for obtaining the names of any other user logged in, you'll have to work something out yourself in your web-apps with some common store (application level? db?) - that would be a violation of security policy that Java EE's not going to support out of box.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top