Package org.apache.cxf.security

Examples of org.apache.cxf.security.SecurityContext


                }

            }
            inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, protHeaders);

            SecurityContext securityContext = buildSecurityContext(message, jmsConfig);
            inMessage.put(SecurityContext.class, securityContext);

            populateIncomingMessageProperties(message, inMessage, messageProperties);
        } catch (JMSException ex) {
            throw JmsUtils.convertJmsAccessException(ex);
View Full Code Here


                return jmsUserName;
            }

        };

        SecurityContext securityContext = new SecurityContext() {

            public Principal getUserPrincipal() {
                return principal;
            }
View Full Code Here

    public AbstractAuthorizingInInterceptor() {
        super(Phase.PRE_INVOKE);
    }
   
    public void handleMessage(Message message) throws Fault {
        SecurityContext sc = message.get(SecurityContext.class);
        if (sc == null) {
            return;
        }
       
        Method method = getTargetMethod(message);
View Full Code Here

            inMessage.put(Message.BASE_PATH, basePath);
        }
        inMessage.put(Message.FIXED_PARAMETER_ORDER, isFixedParameterOrder());
        inMessage.put(Message.ASYNC_POST_RESPONSE_DISPATCH, Boolean.TRUE);
        final Principal pp = req.getUserPrincipal();
        inMessage.put(SecurityContext.class, new SecurityContext() {
            public Principal getUserPrincipal() {
                return pp;
            }
            public boolean isUserInRole(String role) {
                return req.isUserInRole(role);
View Full Code Here

                        boolean bspCompliant = isWsiBSPCompliant(message);
                        principal = parseTokenAndCreatePrincipal(child, bspCompliant);
                        WSS4JTokenConverter.convertToken(message, principal);
                    }
                   
                    SecurityContext sc = message.get(SecurityContext.class);
                    if (sc == null || sc.getUserPrincipal() == null) {
                        if (subject != null && principal != null) {
                            message.put(SecurityContext.class,
                                    createSecurityContext(principal, subject));
                        } else if (principal instanceof WSUsernameTokenPrincipal) {
                            WSUsernameTokenPrincipal utPrincipal = (WSUsernameTokenPrincipal)principal;
View Full Code Here

        }
        msg.setContent(XMLStreamReader.class, reader);
    }
   
    protected SecurityContext createSecurityContext(final Principal p) {
        return new SecurityContext() {

            public Principal getUserPrincipal() {
                return p;
            }
View Full Code Here

                                                Integer.valueOf(val));
                }
            }
            inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, protHeaders);

            SecurityContext securityContext = buildSecurityContext(message, jmsConfig);
            inMessage.put(SecurityContext.class, securityContext);

            populateIncomingMessageProperties(message, inMessage, messageProperties);
        } catch (JMSException ex) {
            throw JmsUtils.convertJmsAccessException(ex);
View Full Code Here

                return jmsUserName;
            }

        };

        SecurityContext securityContext = new SecurityContext() {

            public Principal getUserPrincipal() {
                return principal;
            }
View Full Code Here

    public final MessageContext getMessageContext() {
        return localCtx == null ? context.get() : localCtx;
    }

    public final Principal getUserPrincipal() {
        SecurityContext ctx = (SecurityContext)getMessageContext().get(SecurityContext.class.getName());
        if (ctx == null) {
            return null;
        }
        return ctx.getUserPrincipal();
    }
View Full Code Here

        }
        return ctx.getUserPrincipal();
    }

    public final boolean isUserInRole(final String role) {
        SecurityContext ctx = (SecurityContext)getMessageContext().get(SecurityContext.class.getName());
        if (ctx == null) {
            return false;
        }
        return ctx.isUserInRole(role);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.security.SecurityContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.