Method | Description | |
---|---|---|
Create ( |
Creates a Base64-encoded ticket based on the provided data. The ticket is created using the mod_auth_tkt algorithm. |
|
Create ( string userId, string userData, string tokens, System.DateTime timeStamp, string secret, bool encode = false, string ipAddress = AuthenticationTicketData.DefaultIPAddress, string version = AuthenticationTicketData.DefaultVersion ) : string |
Creates a Base64-encoded ticket based on the provided data. The ticket is created using the mod_auth_tkt algorithm. |
|
ExtractData ( string ticket, string secret = null, bool encoded = false, string ipAddress = AuthenticationTicketData.DefaultIPAddress ) : |
Extracts the data from a provided ticket.
|
|
Validate ( string ticket, string secret, bool encoded = false, string ipAddress = AuthenticationTicketData.DefaultIPAddress, string version = AuthenticationTicketData.DefaultVersion ) : bool |
Validates a ticket based on the provided data.
|
Method | Description | |
---|---|---|
CreateDigest ( |
Creates the digest portion of the ticket from the provided data. The algorithm for the digest is as follows: digest = MD5(digest0 + key) where Version 1.3: digest0 = MD5(iptstamp + key + user_id + user_data) Version 2.0: digest0 = MD5(iptstamp + key + user_id + '\0' + token_list + '\0' + user_data) |
|
CreateIPTimeStamp ( uint ipAddress, uint timestamp ) : string |
Creates the IP Address / Timestamp byte array used in the digest. IPTStamp is a 8 bytes long byte array, bytes 0-3 are filled with client's IP address as a binary number in network byte order, bytes 4-7 are filled with timestamp as a binary number in network byte order. |
|
Decode ( string data, string secret, uint timestamp, int offset ) : string |
Decodes a data string.
|
|
Encode ( string data, string secret, uint timestamp, int offset ) : string |
Encodes a data string.
|
|
GetDecodeIndex ( int a, int b, int c ) : int |
Gets the index in the decoded character string by solving for x in the equation: (x + a) % b = c where x is between 0 and b
|
|
Parse ( string ticket ) : |
Parses the decoded ticket. The expected format of the ticket is: digest (32 chars) + hex timestamp (8 chars) + user ID + '!' + user data OR digest (32 chars) + hex timestamp (8 chars) + user ID + '!' + tokens + '!' user data |
public static Create ( |
||
ticketData | Data used to create the ticket. | |
secret | string | Secret key used to create the ticket. |
encode | bool | True if the user id, user data, and tokens are to be encoded; false otherwise |
return | string |
public static Create ( string userId, string userData, string tokens, System.DateTime timeStamp, string secret, bool encode = false, string ipAddress = AuthenticationTicketData.DefaultIPAddress, string version = AuthenticationTicketData.DefaultVersion ) : string | ||
userId | string | User ID |
userData | string | User Data |
tokens | string | Comma-delimited string of data |
timeStamp | System.DateTime | Time Stamp |
secret | string | Secret key used to create the ticket |
encode | bool | True if the user id, user data, and tokens are to be encoded; false otherwise |
ipAddress | string | IP Address |
version | string | Version of the mod_auth_tkt algorithm used to create the ticket |
return | string |
public static ExtractData ( string ticket, string secret = null, bool encoded = false, string ipAddress = AuthenticationTicketData.DefaultIPAddress ) : |
||
ticket | string | Base64-encoded ticket to parse for data |
secret | string | Secret key used to create the ticket |
encoded | bool | True if the user id, user data, and tokens are encoded; false otherwise |
ipAddress | string | IP Address used to create the ticket |
return |
public static Validate ( string ticket, string secret, bool encoded = false, string ipAddress = AuthenticationTicketData.DefaultIPAddress, string version = AuthenticationTicketData.DefaultVersion ) : bool | ||
ticket | string | Base64-encoded ticket to be validated |
secret | string | Secret key used to create the ticket |
encoded | bool | True if the user id, user data, and tokens are encoded; false otherwise |
ipAddress | string | IP Address used to create the ticket |
version | string | Version of the mod_auth_tkt algorithm used to validate the ticket |
return | bool |