You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- While you make a good effort to add some context to ThoriumBR's answer that might help somebody understand how OAuth tokens and JWTs are different (especially given that OAuth tokens are frequently JWTs), the part about server side sessions and client side sessions seems to skip a few things. Both opaque and structured tokens can be used to implement either server side or client side sessions. Every session that holds data is stateful, it is the server (the authorization server, not necessarily a resource server) that is stateless.Buurman– Buurman2022-11-09 14:44:08 +00:00Commented Nov 9, 2022 at 14:44
- @Buurman how can you implement client side sessions with opaque tokens?user284677– user2846772022-11-09 14:45:38 +00:00Commented Nov 9, 2022 at 14:45
- You simply store the data you want to store clientside, in clientside storage, linked to the opaque token. You don't need to store it in the actual JWT.Buurman– Buurman2022-11-09 14:50:30 +00:00Commented Nov 9, 2022 at 14:50
- @Buurman So how will the server retrieve the session data from the client side?user284677– user2846772022-11-09 14:54:16 +00:00Commented Nov 9, 2022 at 14:54
- 1Why would the server need to retrieve the data? If you want to send it to the server (say, as filter option for a GET call) you can just send it along in the request. If you want to save part of it (say, a persistent preference) you can just POST it to a relevant endpoint. But you can easily keep most (if not all) data clientside only. Note, I'm not saying this is good for every situation, or even my personal preference: I'm just saying it's a somewhat common variation. Think of mobile single player games that have you login but store your progress clientside.Buurman– Buurman2022-11-09 15:03:50 +00:00Commented Nov 9, 2022 at 15:03
| Show 4 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. web-application), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you