-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An unhandled exception has occurred: No service for type 'OidcDebugger.AppTenant' has been registered. #57
Comments
What the error actually means is that the incoming hostname did not match the tenants (domain names) known by the system. Those are stored in appsettings.Development.json for local development, or appsettings.json for production (see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.2#environments-1) Try setting |
Having made that change, I'm just getting a variation of the same stacktrace, only now the page will load in my browser and display it (in addition to the server logs) |
I've also tried
|
@markd315 Can you post the new stacktrace? If the page loads in the browser then most of the application is working. The exception must be throwing from some other part of the app. |
Ah, I misunderstood. Yeah, same error. Can you post the contents of |
I fiddled a little with adding the port in here, but it didn't seem to have an effect. Ultimately I've left the file unchanged from what I saw in your branch. According to git diff, the only changes in the entire repo right now are the applicationUrl from above, the Https comment-out (from way above) and the new Dockerfile. |
Hmm, that is odd. Sorry that it's not super easy to spin up! I haven't tried it inside Docker myself (although that was on my todo list at one point). Can you set Edit: What might be happening is that inside of the Docker container, the hostname is not |
One more thing to try, in addition to setting the environment to Development (above). From here, copy this code:
Place this right after UseForwardedHeaders in Startup.cs. You'll get a whole lot of logs showing what the incoming request looks like from the server POV. |
Hi, rather than continue to go over individual changes, I made a PR so it's easier to visualize, or checkout and debug from a diff. To summarize the new ones, I had to use a different logger var name than the one you suggested based on the existing declaration in Startup.cs. I also tried using the LoggerFactory to get a new instance with
either way I tried it, I didn't see any new logs when hitting localhost, I don't think that the code is reached. |
Ah sorry, that was a copy and paste error on my part. It should use That should get you logs of how the server sees the incoming request. The |
Like I said, I didn't really see any new logs when I tried, it didn't seem like the logging code was reached. Or maybe it was getting piped somewhere other than stdout that I couldn't find. I managed to get the dockerized code working for my use case by simply ripping out all of the multitenant stuff, but I'd still like to merge my PR to your codebase if we can manage to fix it. |
I'm trying to run this dockerized (which I get that you haven't tried yet).
I disabled SSL on this line, no other changes made:
Startup.cs:37. -> //options.Filters.Add(new RequireHttpsAttribute());
It's simple to build and run the app like this, no issues with that part:
I run the curl aimed at my docker container.
curl --location --request POST 'http://localhost:8080/debug' \ --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:82.0) Gecko/20100101 Firefox/82.0' \ --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \ --header 'Accept-Language: en-CA,en-US;q=0.7,en;q=0.3' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --header 'Origin: https://am-gateway.iam-authn-preview.dlas1.ucloud.int' \ --header 'Connection: keep-alive' \ --header 'Referer: https://am-gateway.iam-authn-preview.dlas1.ucloud.int/signin/oauth2/t/platformservices/authorize?client_id=userclient&redirect_uri=https%3A%2F%2Foauthdebugger.com%2Fdebug&scope=openid+profile&response_type=code&response_mode=form_post&nonce=FcwK4zKvo7i&code_challenge=Wrt52wnyD1PhCpTx8G8leifV3bsXF83CSytm_IYXAzk&code_challenge_method=S256' \ --header 'Cookie: _ga=GA1.2.452342025.1605307631; _gid=GA1.2.1594704861.1605307631; _gat_gtag_UA_106432346_2=1' \ --header 'Upgrade-Insecure-Requests: 1' \ --data-urlencode 'iss=https://am-gateway.iam-authn-preview.dlas1.ucloud.int/signin/oauth2/t/platformservices' \ --data-urlencode 'code=mppEP_2Xmgrtt5zd_kj6T5wBYNE.9MHLWyxV3ZYigV1Qdg9CFDg3HkU' \ --data-urlencode 'session_state=bfcf0390b7d90ca4cf3a724bad6aa7307038e54201faf02da336bb98a4c79e71.5edafec3040cea23eb5577adc9636d1f' \ --data-urlencode 'client_id=userclient'
which I stole from my browser (configured for your live site).The output I see is in the issue title:
The text was updated successfully, but these errors were encountered: