Hi Jerome,

jep, that was the case. I changed some code parts in the 
ChallengeAuthenticator and now it works. Thanks.

Best regards,
Tobias

On 12/29/2010 07:42 AM, jlouvel [via Restlet Discuss] wrote:
> Hi Tobias,
>
> Are you touching/consuming the entity in any way inside your custom 
> ChallengeAuthenticator?
>
> As the entity is socket-bound (transient), it can only be read once 
> unless cached.
>
> Best regards,
> Jerome
> -- 
> Restlet ~ Founder and Technical Lead ~ <a href="http://www.restlet.o​ 
> rg" target="_top" rel="nofollow" link="external">http://www.restlet.o​rg
> Noelios Technologies ~ http://www.noelios.com
>
>
>
>
> -----Message d'origine-----
> De : Tobias Girschick [mailto:[hidden email] 
> </user/SendEmail.jtp?type=node&node=5873829&i=0>]
> Envoyé : mardi 28 décembre 2010 14:00
> À : [hidden email] </user/SendEmail.jtp?type=node&node=5873829&i=1>
> Objet : No represnetation entity behind guard
>
> Hi,
>
> I am trying to protect part of my resources with a custom 
> ChallengeAuthenticator. The authentication and authorization works 
> fine. The only thing that's strange is, that as soon as I put a 
> resource behind the guard the methods that handle POST requests don't 
> work anymore. Up to now code like that worked (without guard):
>
> @Post("form")
> public Representation acceptRepresentation(Representation entity) {
>   String uri = null;
>   try {
>   if (entity != null) {
>   if (MediaType.APPLICATION_WWW_FORM.equals(entity.getMediaType(), 
> true)) {
>           Form form = new Form(entity);
>
>           uri = form.getValues("dataset_uri");
>
> [....]
>
> Now that the resource is behind the guard the entity is NULL. The
> createInboundRoot() method in my Application looks like that:
>
> @Override
>     public synchronized Restlet createInboundRoot() {
>         Router router = new Router(getContext());
>
>             /*
>              * Make the entry page not secure to enable easier access and
>              * show the user a form for the "login" in the browser
>              *
>              * All other endpoints should be attached to the secureRouter
>              * to be secured by the OpenTox OpenSSO system
>              * There will be /sec in the URI
>              */
>             router.attach("", SecureIndexResourceTUM.class);
>             router.attach("/", SecureIndexResourceTUM.class);
>
>             /*
>              *  secure URIs
>              *  Available only for tox members
>              *  Enroler = Interface... implemented by Authenticator
>              */
>
>             OpenSSOAuthorizer toxAuth = new OpenSSOAuthorizer();
>             OpenSSOAuthenticator guard = new 
> OpenSSOAuthenticator(getContext(),
> false, "text");
>
>             Router secureRouter = new Router(getContext());
>             toxAuth.setNext(secureRouter);
>
>             secureRouter.attach("", SecResource.class);
>             secureRouter.attach("/", SecResource.class);
>             secureRouter.attach("/userinfo", UserInfoResource.class);
>
>
>             router.attach("/sec", toxAuth);
>             guard.setNext(secureRouter);
>
>             return router;
> }
>
> Any ideas anybody? Is there another possibility to get the form 
> parameters?
> -- 
> View this message in context: 
> http://restlet-discuss.1400322.n2.nabble.com/No-represnetation-entity-behind-guard-tp5871763p5871763.html
>  
> <http://restlet-discuss.1400322.n2.nabble.com/No-represnetation-entity-behind-guard-tp5871763p5871763.html?by-user=t>
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694223
>  
> <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694223>
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694523
>  
> <http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694523>
>
>
> ------------------------------------------------------------------------
> View message @ 
> http://restlet-discuss.1400322.n2.nabble.com/No-represnetation-entity-behind-guard-tp5871763p5873829.html
> To unsubscribe from No represnetation entity behind guard, click here 
> <http://restlet-discuss.1400322.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5871763&code=dG9iaWFzLmdpcnNjaGlja0Bpbi50dW0uZGV8NTg3MTc2M3wtMjA3NzM2NzI5NQ==>.
>  
>

-- 

Dipl.-Bioinf. Tobias Girschick

Technische Universität München
Institut für Informatik
Lehrstuhl I12 - Bioinformatik
Bolzmannstr. 3
85748 Garching b. München, Germany

Room: MI 01.09.042
Phone: +49 (89) 289-18002
Email: [email protected] <mailto:[email protected]>
Web: http://wwwkramer.in.tum.de/girschick


-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/No-represnetation-entity-behind-guard-tp5871763p5874273.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2694574

Reply via email to