Depndency injected IConfiguration returning null.
Hello. I have a little school project that I'm doing and I'm in charge of making a little authentication ASP microservice for our app. It's been going well so far except I've kind of reached a dead end with one of our service methods namely the LoginUser() one, now it's utilities are working well and generating what they have to, and I trust that they'll do their job but the issue mainly comes from the fact that the paramaters they are being passed are null, I get those paramaters from builder.Configuration and that is dependency injected into the AuthService constructor and later used in the LoginUser() method. Obviously with a null value we can't the utilities to work and we get no tokens. So I'm at a loss. If anyone has experienced this type of error before, help would be greatly appreciated.

23 Replies


$paste
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
are the spelling properties identical to those in the config file?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Yes exactly the same.
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
GitHub
H3_The_ReelTok/reeltok.api/reeltok.api.auth at feature/Auth · Magnu...
A less attractive alternative to TikTok. Contribute to MagnusHLund/H3_The_ReelTok development by creating an account on GitHub.
are the other objects correctly loaded in the config?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yeah
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
that was for debugging actually :droidcry:
I'll try
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Another suggestion I have is to work with ProblemDetails, which is the RFC standard for API error responses.
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Man wow, thanks a lot for the feedback like I said it's a school project and we're pressing down a week to implement this whole thing.
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Or make an BLL and DAL layer
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Anyway I'll consider some of these things for tomorrow when I write to the other contributors, thanks a lot again, the issue is fixed now, you were a huge help.