-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
669cd61
commit 6c85286
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ tables into a working REST API, using ASGI. | |
./csp/index | ||
./jwt/index | ||
./csrf/index | ||
./token_auth/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Token Auth | ||
========== | ||
|
||
Introduction | ||
------------ | ||
|
||
Token auth is a simple approach to authentication, which is most suitable for | ||
mobile apps and embedded systems. | ||
|
||
Each user / client has a token generated for them. The token is just a random | ||
string - no information is embedded within it, as is the case with JWT. | ||
|
||
When a client makes a request, the token needs to be added as a header. The | ||
user object associated with this token is then retrieved from a | ||
'token provider'. By default, this is a Piccolo table, but you can implement | ||
your own token provider if you so choose. | ||
|
||
The token doesn't expire. It's suitable for mobile apps where tokens can be | ||
securely stored on the device. The client logic is simple to implement, as you | ||
don't have to worry about refreshing your token. | ||
|
||
It's not recommended to use this type of authentication with web apps, because | ||
you can't securely store the token using Javascript, which makes it | ||
susceptible to exposure using a XSS attack. |