Package org.takes.facets.auth
Class PsToken
- java.lang.Object
-
- org.takes.facets.auth.PsToken
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Opt<Identity>
enter(Request req)
Authenticate the user by the request.Response
exit(Response res, Identity idt)
Wrap the response with the user.
-
-
-
Constructor Detail
-
PsToken
public PsToken(String key)
Ctor. This is equivalent toPsToken(key, 3600)
, signing with 256 bit.- Parameters:
key
- The secret key to sign with
-
PsToken
public PsToken(String key, long seconds)
Ctor. This uses a 256-bit HMAC signature.- Parameters:
key
- The secret key to sign withseconds
- The life span of the token.
-
-
Method Detail
-
enter
public Opt<Identity> enter(Request req) throws IOException
Description copied from interface:Pass
Authenticate the user by the request.- Specified by:
enter
in interfacePass
- Parameters:
req
- The request- Returns:
- Identity of the user found
- Throws:
IOException
-
-