Hi -

If someone can really provide some direction or shed some light with regards
to this question, it will be really great.? Is it feasible in Camel to make
a call to an application which is embedded with Apache Shiro security. The
web application has exposed the functionalities as rest services. I tried
making http calls with Shiro Authentication token set up in the exchange
headers. But its failing. Basically I am unable to mock the Shiro subject
and set in the HTTP header to make it look like a Shiro Authenticated
request. Is this possible in Camel or am I going in the wrong direction? Any
suggestion or help in this regard is very much appreciated. Below is a
subset of code I have been playing around with.

     
 // wrap it in a Subject - (Apache Shiro Principal collection)
               Subject subjectUnderTest = new
Subject.Builder(getSecurityManager())
               .principals(new SimplePrincipalCollection("Username",
"RealmName"))
               .authenticated(true)
               .buildSubject();    
           
                MockEndpoint OutEndpoint = getMockEndpoint("mock.out");
                OutEndpoint.expectedMessageCount(1);
               
                Endpoint InEndpoint = context.getEndpoint("direct.in");
                Map<String, Object> headers = new HashMap<String, Object>();
                headers.put(Exchange.HTTP_METHOD, "GET");
                headers.put(Exchange.AUTHENTICATION, subjectUnderTest);

                template.sendBodyAndHeaders(InEndpoint, "test body",
headers);





--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Apache-shiro-tp5746782.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to