1

I spun up a simple AspNetCore (3.1) web application based on a built in template with in-app authentication (following basic tutorials).

I can run my app and when I try to go to a secured page I'm required to log in.

I register and can log in as expected. I can find my user in the AspNetUsers table in the database.

I want to create "temporary" users that can access some functionality before logging in or registering. This temporary user would be valid for x days, they can save data to the database and can come back to the website and retrieve that data. If they choose to login or register, this data will be either merged to their account, or the temporary account would become permanent.

Should I create a full user in AspNetUsers, or use some separate method to keep this data. If I save it to AspNetUser with a temporary role, they won't have a username, password or email, and I want them to auto-login when they leave and come back. Does functionality like this already exist in AspNetCore Identity?

Founder
  • 626
  • 6
  • 19
  • `want to create "temporary" users that can access some functionality before logging in or registering.` Without log into your app, how can app know a non-authenticated user is "temporary" user or anonymous user? Please clarify more about the scenario and requirement, so that we can understand it better. – Fei Han May 11 '20 at 09:48
  • @FeiHan I'm thinking I would create a temporary user when it's needed, like if they save something to the database – Founder May 11 '20 at 10:24
  • Also interested in this, scenario would be a game where users should be able to start playing immediately only providing a display name. This should persist for a while, with the option to create a full account later. – G684 Dec 08 '20 at 18:02

0 Answers0