Package services.gui
Class ApiTokenService
- java.lang.Object
-
- services.gui.ApiTokenService
-
@Singleton public class ApiTokenService extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.lang3.tuple.Pair<ApiToken,java.lang.String>create(User user, java.lang.String name, java.lang.Integer expires)Generates a new api token and persists its hash in the database.
-
-
-
Method Detail
-
create
public org.apache.commons.lang3.tuple.Pair<ApiToken,java.lang.String> create(User user, java.lang.String name, java.lang.Integer expires)
Generates a new api token and persists its hash in the database. Returns the token and the token string. A token consists of the prefix "jap_" + a random string of 31 characters and a checksum of 6 characters.
-
-