-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
SAML Login Fails With Invalid Response #1016
Comments
I'm not too familiar with social-core or Python, but I've done my best to understand it. |
It turns out the issue faced was proxy related and I had to modify the settings.py configuration to allow the use of the X-Forwarded-Port. After this django provides the correct port to social-auth for the complete URL. Good reference if you run into the same issue:
This issue was especially confusing since the there are multiple places in the UI that state the full URL of the server including protocol and social-auth determines these values from django instead. |
Can you explain a little about how you mounted settings.py as a volume? I tried changing I'm getting the same error you've provided here. |
@BenJuan26 we just mount a modified settings.py outside the container and mount it in the container as a volume for the time being. When you run your docker-compose add arguments similar to this for awx_web:
More information here on volumes/mounts: https://docs.docker.com/storage/volumes/#start-a-container-with-a-volume |
So the way I fixed this to work correctly with SAML was by building the container images locally and pushing them to the remote AWX server. This alleviates the need to mount a volume. First I commented out the following lines in
This allows you to build the container image locally instead of pulling from ansible's dockerhub images. Next I added the following lines to
This is what gets injected into the container images for the web and task containers. Then I configured the nginx reverse proxy on the AWX remote host. My config looks like this:
The important line here is Lastly, I added the I used https://gist.github.com/defionscode/fc21488e44d73cdd919f81ee1b43e204 as a reference for how my SAML config should look. |
Hello @sudomateo |
I believe you would have configuration options like this under your frontend to overcome the challenges we faced noted above. Good luck! |
How to fix the issue if its running in kubernetes, How to configure the NGINX reverse proxy |
@sudomateo I'm facing the same issue, But the changes I did for enabling tls is completely different of what you used in nginx.conf.
I'm trying to make use of your nginx configuration, but my awx_web is not working and I don't see any errors. Do you have any turn around so that I can use your configuration in the above. Any help is appriciated, Thanks. |
I'm putting my reply here too. If the Nginx that forward its requests to the Django server (the uwsgi_pass uwsgi;) isn't running on a standard port (like here, it's running in the 8053) you can either :
And off you go. The error :
Should be gone.
I haven't seen much ADFS SAML configuration available and since I had quite some trouble setting it up, I'm also adding my ADFS configuration for "SAML ENABLED IDENTITY PROVIDERS"
Big thanks to this thread : pallets/werkzeug#1465 (comment) for the enlightenment |
Add the uwsgi_param 'HTTP_X_FORWARDED_PORT' to nginx configuration, This prevents the python-saml "invalid_response" error related issue : ansible#5570 and ansible#1016 Signed-off-by: loitho
Hello All, I found a fix, tested and working. Credit goes to [ https://medium.com/@_jonas/traefik-kubernetes-ingress-and-x-forwarded-headers-82194d319b0e ] This kind man, thank you. If you using k3s or Kubernetes and Traefik, you can edit this file Traefix is setup using Helm Chart. Edit it and add the three line with #< with it.
Helm will redeploy your traefix pod, once restarted give it a 10 min. Then check. |
ISSUE TYPE
COMPONENT NAME
SUMMARY
When logging into AWX with SAML configured the final redirect appears to be to an incorrect port that is of the container and not the web interface.
ENVIRONMENT
STEPS TO REPRODUCE
Configure AWX with a SAML Identity Provider. The SAML portion of the authentication appears to work up to the point where a redirect occurs to an incorrect port and protocol (that appears to be the port and protocol on the docker container) and not that which the web/API is hosted from.
It appears this may be a regression from the transition from social-app-django to social-auth-core and social-auth-app-django.
There has been some activity here that seems related: #119 but it looks like there have been changes in the authentication back-end since it was closed and the issue covers multiple challenges.
EXPECTED RESULTS
Redirected to the URL that includes the hostname and port of the web/API logged in.
ACTUAL RESULTS
An error after successfully logging into the IDp.
The text was updated successfully, but these errors were encountered: