❔ Identity authentication
Hello everyone! Im studying system developer.net. We did CarRental project asp.net mvc and web api. Next task from teacher is we need to add security on web api with JWT bearer token. (This part is done) but authentication on web clientside either from intern database for user or extern provider i really need help with. Identity create database on client side to store users for authentication but on web api there is also database for users , booking , car and carcategories so how do i sync both users database? sorry for my bad explanation but im so confused, plz help. Thanks in advance.
14 Replies
if you mean the records for the users are doubled in two dbs, you shouldn't
There's no such thing as a clientside web database
Unless you're using some library that wraps native storage methods of the browser
i mean Indentity create AspNetUser database in mvc
but in api it has its own dbs,
A table
It's all the same database
Just different tables
hmm then how so i connect these 2 tables? on mvc and api?
Is it two different projects?
it’s the same project, MVC call to API to get the information in DBS. MVC show only information from API
How exactly does MVC call that API?
From the frontend, with Javascript?
Or from the backend, in the controller?
and in mvc repository
only api know the connectionstring to dbs
Any reason why you're not just doing the database stuff from the repository?
Since it's the same project, why suffer the additional latency and performance price of an HTTP call?
well thats because my teacher want us to use mvc and api, at first we only had mvc connect direct to database, then he wanted us to learn how api works so he wanted us to change from mvc direct to dbs to mvc -> api ->dbs insted.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.