accesstoken_class
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| accesstoken_class [2019/10/25 12:07] – created sahl | accesstoken_class [2021/02/11 13:47] (current) – [Accesstoken class] Explained anonymous token sahl | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| </ | </ | ||
| - | 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 28: | Line 36: | ||
| </ | </ | ||
| - | To check if a user is allowed one can simply | + | To check for a valid access token, |
| <code php> | <code php> | ||
| Line 36: | 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 can be performed like: | ||
| + | |||
| + | <code php> | ||
| + | Accesstoken:: | ||
| + | </ | ||
| + | |||
| + | This will destroy the entire PHP $_SESSION variable. To only destroy the Platform login session information, | ||
accesstoken_class.1572005262.txt.gz · Last modified: 2019/10/25 12:07 by sahl