-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
OpenIdApplicationManager is using http redirect_uri
instead of the provided https address for the app
#13816
Comments
@kevinchalet is this an issue in OrchardCore or the OpenIdConnect library? |
It’s essentially the same root cause as your last question: your OC client app is not configured to restore the HTTP scheme from the forwarded headers and the MSFT OIDC handler thinks the request didn’t use HTTPS and creates an incorrect ˋredirect_uri`. Try to enable the "proxy" feature in your OC client app hosted in Azure. |
Now I am confused :) Why would my client app need to worry about proxy settings. The client app is hosted on Azure and is only running on |
It's not your proxy server, but your client app is definitely running behind a reverse proxy, you're just not realizing it (otherwise, enabling the "proxy" module would have no effect 😃) In this case, the reverse proxy is managed by Microsoft and is used to do TLS termination before the web worker has even a chance to handle the requests. In the past, it was performed using Application Request Routing (ARR) but I heard they moved/are moving to YARP (which is why it's basically driven by Azure's needs these days). That's the problem with cloud offers: you generally have no idea what happens under the hood 🤣 |
Thanks for your help! This differently puzzled me. |
I am having an issue where the OpenID Server is seeing the
redirect_uri
ashttp
NOT ashttps
which is what I have in the settings of the application.Current Application Settings (OpenID Server App)
I added a new application by navigating to
Security
>>OpenID Connect
>>Management
>>Applications
In the "Redirect Uris" input I provided
https://subdomain.domain-example.com/signin-oidc
which starts withHTTPS
as you can see belowCurrent Client Settings (OpenID Client App)
From a completely different OrchardCore app "hosted in Azure", I enabled the OpenID Client feature and configured it to connect to the openId server. I navigated to
Security
>>OpenID Connect
>>Authentication client
During login, I click on My OpenId Server Name provide button to login using the OpenIdServer. This redirects me to the server as expecting. However, the OpenId Server app displays the following error
When I check the OpenID Server app logs I can see that the
return_uri
is indeed invalid. Here is a dump of what I see in the logsProblem here is that something is overriding the
https
tohttp
.OpenIdServer Hosting Setup (Behind Proxy)
I have OrchardCore project running on IIS 2019. I enabled the
Reverse Proxy Configuration
feature and enabled theX-Forwarded-*
headers.This app is running on
openid.internal-domain.net
and is not accessible to the outside traffic. On another server, I have an app running on IIS 2019 server that redirects traffic from external domainopenid.external-domain.com
toopenid.internal-domain.net
. My reverse proxy sets theX-Forwarded-Host
and theX-Forward-Proto
andX-Forwarded-For
as expected.Here is the app settngs. as you can see the app scheme is set to
https
Reverse proxy server variables which shows how I am setting the proto to
https
Here are the
/.well-known/openid-configuration
from the server when accessed externally.The text was updated successfully, but these errors were encountered: