accesstoken_class
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| accesstoken_class [2019/12/19 21:48] – sahl | accesstoken_class [2021/02/11 13:47] (current) – [Accesstoken class] Explained anonymous token sahl | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| // Write the token code to the session | // Write the token code to the session | ||
| $token-> | $token-> | ||
| - | // Redirect the user back to where she tried to enter | ||
| - | Accesstoken:: | ||
| </ | </ | ||
| - | It is typically | + | This is boiled into a number of methods. |
| + | |||
| + | <code php> | ||
| + | $token = Accesstoken:: | ||
| + | </ | ||
| + | |||
| + | The code above acquires an access token which isn' | ||
| + | |||
| + | To associate an access token with a user, this is done like: | ||
| <code php> | <code php> | ||
| Line 30: | Line 36: | ||
| </ | </ | ||
| - | To check if a user is allowed one can simply | + | To check for a valid access token, |
| <code php> | <code php> | ||
| Line 38: | Line 44: | ||
| // The options below will cause a successful validation to make the session valid for ten more minutes. | // The options below will cause a successful validation to make the session valid for ten more minutes. | ||
| - | Accesstoken:: | + | Accesstoken:: |
| </ | </ | ||
| + | |||
| + | If you make a check like above and redirect the user to a login-page, you can afterwards call the '' | ||
| ===== Logout ===== | ===== Logout ===== | ||
accesstoken_class.1576792098.txt.gz · Last modified: 2019/12/19 21:48 by sahl