-
Notifications
You must be signed in to change notification settings - Fork 8
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
Issue with setting up redirect_uri and redirect_listen_address #50
Comments
I have the same problem. Did you solve it? |
I just felt like commenting as I spent the better part of a few hours trying to figure this out. My oauth2 proxy needed authorization again for the first time in...years... and I was really struggling with figuring out how to get it done without spinning up a copy on my windows machine and then just copying that config back to the linux machine. I figured now would also be a good time to switch to a docker version. So, here's the secret sauce. The clue came when my brain finally realized how the documentation is written:
Why, that's not a valid IP address! That looks more like an allow mask of sorts! So I figured I'd try http://0.0.0.0:80
Success! I also setup a reverse apache proxy for my needs. So on my application ID on my tenant, I specify an https://smtp.lan.domain.com as one of the permitted URLs. That host is not routable online, only internally. On my docker compose, I mapped e.g. port 5580 to port 80 internally. Then my reverse proxy does https tunnelling to http://smtp.lan.domain.com:5580 So when you make an authentication request, you hit the apache proxy on :80, which forwards the traffic to :5580, which maps to the internal docker container running on :80. Whew! Works great for me now. |
@incith Thanks for commenting on the docker install. Thanks |
@ClearlyDazed My redirect URI is https://smtp.internal.domain.com essentially. There are some layers to that alone -- I use a DNS server (pfSense) at home to resolve that to an internal IP address, of the docker container running oauth2-proxy. pfSense also runs acme certs which renews my domain certificate, of which I have a wildcard for *.internal.yourdomain.com. This address does not resolve externally, it is not in public DNS. I only specify redirect_uri in my [email@domain.com] config, which is https://smtp.internal.domain.com -- I believe I had also used something initially for redirect_listen_address as mentioned above, but it appears commenting it out accomplished the same thing (I actually don't remember testing that... but that's what my current config shows) I do also run apache on the host machine that runs the docker container, and so I have a virtualhost config for smtp.internal.yourdomain.com. Pretty basic config to redirect to the http port I've assigned to the docker container. Docker Compose/Portainer:
Apache:
Good luck! |
@incith, thank you so much! Just looking to clear up the actual emailproxy.config part, as you didn't put in your actual config. I have a similar-ish setup:
with that said, my config:
|
hi, i am facing an similiar issue. @aaronspruit
but my thougths were, the local server needs to listen to 80 insde the docker, because of the docker mapping 1580:80 ?? |
The port that the smtp proxy should be listening on is something OTHER than port 80. For example, in my configuration below shows the port that the container is listening on (and what things looking to send SMTP messages will connect to). As you're using docker, you will either expose port 1587 (1587:1587) and have your clients connect to that, or use some other port that is not port 80. This expose port has NOTHING to do with the redirect_listen_address port, other than they cannot be the same.
|
hi, thx for your reply... I solved the issue. => the server comes up, opens up the according port, specified in redirect_listen_address. I had a unclear revers proxy config; after solving this, everything went smoothly. |
I am attempting to setup and configure this docker container and have been having issues identifying the correct redirect values for my setup. Truncated docker and emailproxy.config are below. My docker host server IP is
10.10.10.3
and my docker container IP is172.24.0.10
. After triggering an email auth request and pasting in the authentication URL and successfully authenticating in O365, I get the following errors:Firefox can’t establish a connection to the server at localhost:8087.
orAn error occurred during a connection to 10.10.10.3:8087.
I've tried various redirect URL combos with my IP addresses mentioned above (and updated the O365 app Redirect URI to match) but nothing seems to be working.Thank you for the insight and assistance!
docker-compose
.env
emailproxy.config
In addition to the above redirect URI/Listen address, i've tried the following combo's and more:
The text was updated successfully, but these errors were encountered: