Ferreteria/sql/user token: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
m (syntax fix)
(more secure)
Line 5: Line 5:
==SQL==
==SQL==
<mysql>CREATE TABLE `user_tokens` (
<mysql>CREATE TABLE `user_tokens` (
   `ID_Email`         INT NOT NULL COMMENT "ID of email address being authorized",
   `ID_Email`             INT NOT NULL COMMENT "ID of email address being authorized",
   `TokenVARCHAR(128) NOT NULL COMMENT "token string",
   `TokenHash` VARBINARY(128) NOT NULL COMMENT "hash for [token+salt]",
   `WhenExp`     DATETIME NOT NULL COMMENT "when the token expires (and should be deleted)",
   `TokenSalt` VARBINARY(128) NOT NULL COMMENT "random prefix for hash",
   `WhenExp`         DATETIME NOT NULL COMMENT "when the token expires (and should be deleted)",
   PRIMARY KEY(`ID_Email`)
   PRIMARY KEY(`ID_Email`)
)
)
ENGINE = MYISAM;</mysql>
ENGINE = MYISAM;</mysql>

Revision as of 01:35, 4 October 2013

About

  • Purpose: for storing tokens that authorize users to change things associated with an email address (mainly password)
  • History:
    • 2013-10-03 created

SQL

<mysql>CREATE TABLE `user_tokens` (

 `ID_Email`             INT NOT NULL COMMENT "ID of email address being authorized",
 `TokenHash` VARBINARY(128) NOT NULL COMMENT "hash for [token+salt]",
 `TokenSalt` VARBINARY(128) NOT NULL COMMENT "random prefix for hash",
 `WhenExp`         DATETIME NOT NULL COMMENT "when the token expires (and should be deleted)",
 PRIMARY KEY(`ID_Email`)

) ENGINE = MYISAM;</mysql>