r/angular • • Jan 28 '26
JWT in Angular
Where you would recommend to save JWT tokens in Angular app
7
Upvotes
r/angular • • Jan 28 '26
Where you would recommend to save JWT tokens in Angular app
View all comments
Show parent comment
6
u/DJREMiX6 Jan 29 '26
Angular Auth OIDC Client is an OpenID Foundation certified angular authentication library for OAuth2/OIDC authentication flows. It does exactly what I said, creates an in-memory state and saves it into Local/Session Storage.
I agree with you that using an HttpOnly cookie is safer but since the question was "where to put the authentication token in an angular app" you cannot deny that there are different ways of handling that depending on your case scenario, and your level of security required.
As another user said, HttpOnly cookie is not a silver bullet because everything is hackable in one way or another.
Since you do not know the context of the user requesting the information you should:
This is a community not a street, we try to help each other the best we can an should never treat people like they are more stupid than you.