-
Notifications
You must be signed in to change notification settings - Fork 247
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
Wrong redirect URI when using Oauth with AAD ( http instead of https ) #3612
Comments
I think this is caused by the fact that BC offloads the handling of SSL to traefik when running traefik - and as such, BC doesn't know it is running SSL. Could you paste CustomSettings.config from the container here? |
Sure thing. (I replaced the application ID ) Content:
|
Yeah, so even though the publicwebbaseUrl is https:// - then ClientServicesSSLEnabled is false. |
Thanks for the reply , we already tried that, unfortunately as per https://learn.microsoft.com/en-us/entra/identity-platform/reply-url reply-to addresses have to begin with https:// can i by any chance manually change the settings after the Container is created? |
Is this a new bug - or did this bug exist in older versions of BC as well? |
We noticed the bug around dec 23 - jan 24 in BC23 , when we first started trying to implement Oauth. so at least since then. |
Could you try to modify the WSFederationLoginEndpoint setting to
Just to see whether the parameter is ignored totally or reconstructed. Remember to restart the container after making the change. |
I have emailed the product team which is working on this area on whether this is a bug in the platform? |
ok thanks, i hope to get an update whether this will be fixed or there is a workaround |
Hi, |
I think the problem could be that your proxy server needs to include the right header to BC web server as described here: The most important is to set X-Forwarded-Proto header. (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto) |
@tfenster do you know how to get traefik to transfer this header? |
Which load balancer do you use? |
It is setup with traefik |
It is likely something like this: https://doc.traefik.io/traefik/v2.3/routing/entrypoints/#forwarded-headers which needs to be setup for the traefik container |
@freddydk if I remember correctly, I was never able to successfully set this up with Traefik v1, because I could never make BC pick it up. The relevant documentation should be here https://doc.traefik.io/traefik/v1.7/configuration/entrypoints/#forwarded-header, at least if bccontainerhelper is used to set up Traefik, which still uses v1.7, I think |
Does that mean that it is currently impossible to use BC with traefik and AAD oauth? where would be the correct place be to raise that issue? |
It means that the problem is in the traefik setup - which I unfortunately know very little about. Not sure whether there are anybody out there who could update the traefik implementation in BcContainerHelper to a newer version and include support for this. |
@ChrisChristophers have you tried running the containers with https? Technically speaking not required as the client would never get the https cert from the container, but that way the container should generate an https redirect |
@tfenster , we're using the -useSSL switch when creating the container or is there something else to it? |
@ChrisChristophers, no I expected this switch to do the trick. Very weird. Can you check the environment variables of the container, does it have |
Very weird, can't see why this navcontainerhelper/ContainerHandling/New-NavContainer.ps1 Lines 1755 to 1759 in 2eb7de4
navcontainerhelper/ContainerHandling/New-NavContainer.ps1 Lines 692 to 694 in 2eb7de4
forceHttpWithTraefik , which would trigger this? navcontainerhelper/ContainerHandling/New-NavContainer.ps1 Lines 689 to 691 in 2eb7de4
@freddydk, any idea why |
@tfenster we are not setting the switch manually ( the script i'm using is in my first post ) but i'm not sure whether this might set it?
|
@ChrisChristophers how does your |
|
How did you set that up? It indeed is missing the |
we are using the standard BCContainerHelper 6.0.19 module , with the script above ( first post ) the only thing we customized is:
to
( idk how to reference properly ) |
yes, but at some point you have set up the Traefik containers. And it looks like you forced http there |
yes indeed it was setup like this but if i manually set $forcehttpwithtraefik to false in New-NavContainer.ps1 traefik doesn't pick up the container at all. can't see it in the dashboard or connect to the web client
could setting up a new traefik container help? |
I don't know how advanced your setup currently is, but the
Could that work for you? |
Thank you for your reply. We will try to set up a new host within our organization and follow your instructions. As soon as we have progress here, @ChrisChristophers or I will provide feedback. |
@tfenster Hi, unfortunately we have to run the script with -forceHttpWithTraefik because our Loadbalancer is handling the SSL and the we have no certificate option for the traefik container. Our Loadbalancer is sending the X-Forwarded-For that apparently doesn't get passed through? Is there an option to maybe modify the traefik.toml for SSL to work within the BC container anyway ? Thanks for the help so far ! |
@ChrisChristophers Unfortunately not that I know of. The setup explained above was the only one I could get to work. Doesn't mean that it is impossible, but I don't know how |
well, your container can just use it's own certificate that it created anyway when you have useSSL enabled, or? I really hope it does, caus that's also what I am doing :D |
@KristofKlein , so you're traefik container is setup without -forcehttpwithtraefik , but still listens on :80 ? if i use -forcehttpwithtraefik the -useSSL switch doesn't work in container. Will there be native support of traefik v2 in the future? |
I probably won't have any time to look at traefik v2 support for containerhelper, but I would be happy to review a contribution if someone can create a PR. |
Describe the issue
The redirectURI uses http instead of https despite us using https in the script
(note: our frontend.endpoint in traefik is http because we use a loadbalancer for handling https )
but that shouldn't affect the redirection from the application , right ?
when trying to connect to the container the redirectURL contains:
......&redirect_uri=http%3A%2F%2Fbctest.sw.data.com%2Fbc-test-aad%2FSignIn......
and brings this error since you can't use http in AAD:
if i manually change http to https it works perfectly fine. why is the URL wrong though? is it overwritten in the script at some point?
Script for creating the container:
BCContainerhelper version 6.0.19
The text was updated successfully, but these errors were encountered: