REST API - Should i create an access token for a user for each device/plateform he/she used?

Viewed 165

I have a question regarding the token i send to every resquest from my webapp to my backend API.

My question is: Should i have 1 token per user... or 1 token per device per user..

I mean, if a user login from a mobile phone, and then from a computer with Google Chrome, and also.. with another browser such FireFox or Edge(or other).. should i create a new token for this user for every device and browser the user use ? So in that case, this user will have 3 tokens.

Thank you so much !

Have a great day !

1 Answers

It depends on the limitations you want to put on it. Personally, I would put a single token per user and make it record each time they log in on a different device, so that with the same token (which is easier to manage) you can know how many devices they are using it on.

Related