Hi,

you may want to have a look at
org.apache.cxf.rs.security.oauth2.utils.OAuthContextUtils

Regards,
Thorsten

Am 11.03.2014 07:09, schrieb XiLai Dai:
> Hi,
>
> We have a REST service impl class and just want to get the authentication 
> user info from the impl of one operation, it looks like:
>
> public class FlowManagementServiceImpl implements FlowManagementService {
>     @Context
> private org.apache.cxf.jaxrs.ext.MessageContext mc;
>
>     @GET
>     @Path("/deploy/{flowName}/{flowVersion}")
>     @Produces("text/plain")
>     public Response deployFlow(@PathParam("flowName") String flowName,
>             @PathParam("flowVersion") String flowVersion) {
>     ......
>     System.out.println("role: " + 
> mc.getSecurityContext().getUserPrincipal().getName());
>     ......
> }
> }
>
> Seems only the principlal name can be retrieved from MessageContext, how to 
> get the Subject (user) name from the operation? Thanks!
> (CXF 2.7.10 used)
>
> Thanks.
> Xilai Dai
>

Reply via email to