Revoke HTTP Basic Authentication

2011-09-01 Thread Markus Hillenbrand
Hi

In my scenario I am using a ChallengeAuthenticator with a special Verifier that 
checks username and password of a HTTP Basic Authentication with an external 
Java application:

final ChallengeAuthenticator guard = new 
ChallengeAuthenticator(null,ChallengeScheme.HTTP_BASIC,REALM);
guard.setVerifier(verifier);

The HTTP Basic Authentication works fine, but now I want to add the possibility 
for users to log off (i.e. by calling /logoff). I can tell my own Verifier that 
the user has logged off, but how do I tell the Restlet framework that the user 
will have to re-authenticate when he accesses any resource again (in the same 
session)? 


Best regards

Markus

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


RE: Headers in 2.1

2011-09-01 Thread Jerome Louvel
Hi Alex,

You are correct, this has already been fixed in the latest snapshots:
http://www.restlet.org/documentation/snapshot/jse/api/org/restlet/Message.html#getAttributes%28%29

Best regards,
Jerome
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.o​rg
Noelios Technologies ~ http://www.noelios.com



-Message d'origine-
De : ale...@milowski.com [mailto:ale...@milowski.com] De la part de Alex 
Milowski
Envoyé : jeudi 1 septembre 2011 04:05
À : discuss@restlet.tigris.org
Objet : Headers in 2.1

I think this is out of date:

   
http://www.restlet.org/documentation/2.1/jse/api/org/restlet/Message.html#getAttributes()

The instance returned for org.restlet.http.headers is typed as 
Seriesorg.restlet.engine.header.Header

--Alex Milowski

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

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


isAvailable() returning false on EmptyRepresentation

2011-09-01 Thread Alex Milowski
I've been using isEntityAvailable() as a guard for null
representations and ran into a snag with HEAD requests.  The server is
returning the Content-Length and Last-Modified header on the HEAD
request and the client's Response instance gets an
EmptyRepresentation.  By default, isAvailable() on EmptyRepresentation
returns false and so isEntityAvailable on Request returns false.

The result is that instead of doing:

   if (response.isEntityAvailable()) {
   Representation entity = response.getEntity();
   ...
   }

I now have to do:

   Representation entity = response.getEntity();
   if (entity!=null) {
  ...
   }

For other requests where the entity body is returned, the first case
works and is more readable (at least, to me).

After reading the API documentation again, I'm questioning the value
of using isEntityAvailable() as the Represenation instance could cause
undesirable error states when isAvailable() returns false for some
reason.

What is the intended use isEntityAvailable() considering empty
entities and requests like HEAD versus those that just might be
slow?

--Alex Milowski

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