Ikinidae
Two Factor Authentication with IdentityServer4
Hi all guys, I'm here again asking for your help!
I have an api project where I've been asked to implement a two factor authentication and I did it this way.
The first api has in input email and password and give in response the otp code (it's a test api so it doesn't matter that the code is given in the response for the moment); the second one has in input the otp code and give in response the access token.
The message was too long so I have to put the code in the file 😦
The problem is that all of this works perfectly fine in local but gives some problems on frontend (Angular), there are some kind of problems with the cookie that is generated but not accepted by the browser, so my boss asked me to try something else, using the session instead of the cookie. Is this possible or correct?
If u all have any kind of suggestions on everything pls tell me, I'm willing to improve!
Thanks ✨
1 replies
❔ Serilog: how to write a file for single level
Hi guys! I've been asked to write log levels Information, Warning and Error in development, but each of them in one separated file, so that I have information.txt containing only Information logs, warning.txt containing only Warning logs, Error.txt containing only Error logs.
This is my implementation at the moment (it works):
In Program.cs:
in appsettings:
I have installed Serilog.Expressions package and read the docs, I know I have to use something like this
but I can't understand where it should be placed. I've tried placing it in Args or between Args and Name but it doesn't work, can somebody help me? 🥺
7 replies
❔ Controller routing with dynamic parameter
Hi all guys!
That's my first post so I don't know if I'm doing anything wrong, in case let me know!
I have an api project with a lot of api that are gonna be used for both a website (control panel) and a mobile app (for customers). My controllers are all like this:
that means that my url looks like this: https://localhost:5000/api/v1/Agent
What I need is to specify in the url if that api will be used in app or web, so that my url will look like this: https://localhost:5000/api/web/v1/Agent
That parameter has to be specified for every api just like [HttpGet("GetAgentById")].
I obviously searched on web but I haven't found anything 😦
Thanks a lot ❤️
6 replies