Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); securityAdaptor.pushSubjectContext(subject, principal, credential);
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; } }
Principal principal = securityAdaptor.getPrincipal(); Subject subject = SecurityActions.getAuthenticatedSubject();
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; } }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; } }
final Principal principal = securityAdaptor.getPrincipal(); final Object credential = securityAdaptor.getCredential();
final Principal principal = securityAdaptor.getPrincipal(); final Object credential = securityAdaptor.getCredential();
final Principal principal = securityAdaptor.getPrincipal(); final Object credential = securityAdaptor.getCredential();
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential();
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }
private org.jboss.invocation.Invocation getMBeanInvocation(Invocation inv) { // EJB2.1 endpoints will only get an JAXRPC context MessageContext msgContext = inv.getInvocationContext().getAttachment(MessageContext.class); if (msgContext == null) throw new IllegalStateException("Cannot obtain MessageContext"); SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider(); SecurityAdaptor securityAdaptor = spiProvider.getSPI(SecurityAdaptorFactory.class).newSecurityAdapter(); SecurityContext sc = SecurityContextAssociation.getSecurityContext(); Principal principal = securityAdaptor.getPrincipal(); Object credential = securityAdaptor.getCredential(); if (principal == null && sc != null) principal = sc.getUtil().getUserPrincipal(); if (credential == null && sc != null) credential = sc.getUtil().getCredential(); Method method = inv.getJavaMethod(); Object[] args = inv.getArgs(); org.jboss.invocation.Invocation jbInv = new org.jboss.invocation.Invocation(null, method, args, null, principal, credential); HandlerCallback callback = inv.getInvocationContext().getAttachment(HandlerCallback.class); if (callback == null) throw new IllegalStateException("Cannot obtain HandlerCallback"); jbInv.setValue(InvocationKey.SOAP_MESSAGE_CONTEXT, msgContext); jbInv.setValue(InvocationKey.SOAP_MESSAGE, ((SOAPMessageContext)msgContext).getMessage()); jbInv.setType(InvocationType.SERVICE_ENDPOINT); jbInv.setValue(HandlerCallback.class.getName(), callback, PayloadKey.TRANSIENT); jbInv.setValue(Invocation.class.getName(), inv, PayloadKey.TRANSIENT); return jbInv; }