C
C#2y ago
Natt

❔ 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
Omnissiah
Omnissiah2y ago
if you mean the records for the users are doubled in two dbs, you shouldn't
Angius
Angius2y ago
There's no such thing as a clientside web database Unless you're using some library that wraps native storage methods of the browser
Natt
NattOP2y ago
i mean Indentity create AspNetUser database in mvc but in api it has its own dbs,
Angius
Angius2y ago
A table It's all the same database Just different tables
Natt
NattOP2y ago
hmm then how so i connect these 2 tables? on mvc and api?
Angius
Angius2y ago
Is it two different projects?
Natt
NattOP2y ago
it’s the same project, MVC call to API to get the information in DBS. MVC show only information from API
Angius
Angius2y ago
How exactly does MVC call that API? From the frontend, with Javascript? Or from the backend, in the controller?
Natt
NattOP2y ago
Natt
NattOP2y ago
and in mvc repository
Natt
NattOP2y ago
only api know the connectionstring to dbs
Angius
Angius2y ago
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?
Natt
NattOP2y ago
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.
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server