org.semispace.ws
Class TokenFromSpaceAuthenticator

java.lang.Object
  extended by org.semispace.ws.TokenFromSpaceAuthenticator
All Implemented Interfaces:
TokenAuthenticator

public class TokenFromSpaceAuthenticator
extends Object
implements TokenAuthenticator

Query on simple name / value elements read from space. This implementation exist as an example and for the benefit of junit tests. You will want to implement your own version in a live situation.

See method doc for more information.

See Also:
NameValueQuery

Constructor Summary
TokenFromSpaceAuthenticator()
           
 
Method Summary
 String authenticate(String username, String password)
          As we use NameValueQuery from the semispace-main, we prepend the name field with authname= in order to avoid name clashes.
 boolean isTokenValid(String token)
          Side effect: The token life was renewed
 void setSpace(SemiSpaceInterface space)
          For the benefit of spring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenFromSpaceAuthenticator

public TokenFromSpaceAuthenticator()
Method Detail

setSpace

public void setSpace(SemiSpaceInterface space)
For the benefit of spring


authenticate

public String authenticate(String username,
                           String password)
As we use NameValueQuery from the semispace-main, we prepend the name field with authname= in order to avoid name clashes.

Specified by:
authenticate in interface TokenAuthenticator
See Also:
TokenAuthenticator.authenticate(java.lang.String, java.lang.String)

isTokenValid

public boolean isTokenValid(String token)
Side effect: The token life was renewed

Specified by:
isTokenValid in interface TokenAuthenticator
Returns:
If the token was found to be valid
See Also:
TokenAuthenticator.isTokenValid(java.lang.String)


Copyright © 2008-2012. All Rights Reserved.