Method | Description | |
---|---|---|
GenerateToken ( ) : string |
Generates a new authentication token using a crytographically-secure random number generator
|
|
GetExpiration ( ) : System.DateTime |
Returns a DateTime object that represents the moment the token expires
|
|
TrimMilliseconds ( System.DateTime dt ) : System.DateTime |
Because dateTimes are stupid
|
|
UserToken ( String username, System.DateTime expires, string token ) : System | ||
Verify ( |
Verifies that two tokens are equal to each other and the "expires" date has not passed. Uses SlowEquals to prevent timing attacks.
|
public static GetExpiration ( ) : System.DateTime | ||
return | System.DateTime |
public static TrimMilliseconds ( System.DateTime dt ) : System.DateTime | ||
dt | System.DateTime | |
return | System.DateTime |
public UserToken ( String username, System.DateTime expires, string token ) : System | ||
username | String | |
expires | System.DateTime | |
token | string | |
return | System |
public Verify ( |
||
token | Token to compare | |
return | bool |