-
Notifications
You must be signed in to change notification settings - Fork 70
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
add an option to use gateway hostname as server #93
Conversation
To describe the use case a bit more, I currently need to instruct our users to:
With the change, I can instruct our users to run only: |
gp_saml_gui.py
Outdated
@@ -230,6 +230,7 @@ def parse_args(args = None): | |||
p = argparse.ArgumentParser() | |||
p.add_argument('server', help='GlobalProtect server (portal or gateway)') | |||
p.add_argument('--no-verify', dest='verify', action='store_false', default=True, help='Ignore invalid server certificate') | |||
p.add_argument('-G', '--gateway-is-server', action='store_true', help='Use specified gateway hostname as server, ignoring redirects') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just name this --ignore-redirects
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can do that, if you think that is a better name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the pr to use p.add_argument('-i', '--ignore-redirects',
.
I'm aware of this issue, but I really wish we could "autodetect" the correct solution rather than requiring users to figure it out and specify yet another configuration option.
For some but not all of your gateways? (If so, sounds like they're misconfigured 🤔) |
When do you run into this? I'm wondering if there's some sort of load balancer in play with something incorrectly configured. |
I agree, but I don't know how to go about autodetecting it. If there's any information I can provide that could help, let me know. I don't know much about the globalprotect gateways; I'm a VPN user, but I can relay questions to our network engineer.
I think I meant "we" as in "users of gp-saml-gui in general". I probably could have phrased that better. The behavior is consistent for the gateways in use at my company. |
My rough could-be-wrong understanding is that global protect provides two kinds of entities:
I think in our case, the gateway is providing a redirect to a portal. |
gp-saml-gui can auth to the portal via the
The user can then type in which gateway to use, then use gp-saml-gui again to auth to the gateway this time, then paste in the prelogin-cookie for the gateway. Openconnect will proceed to use the gateway. Unless there's some much better way to do this, I think it's easier to have gp-saml-gui auth directly to the desired gateway from the start. I really don't know this very well, though. |
If we're going to add an argument, shouldn't it align with OpenConnect's implementation:
https://gitlab.com/openconnect/openconnect/-/issues/151#note_353162354 |
If the portal and gateway are on separate servers, then it seems weird that you could authenticate directly to a gateway as that would presumably defeat the purpose of having the portal separate from the gateway. I could see it being useful to have something like |
I'm not sure; I could go with whatever, as long as there is some sort of option. -Corey |
I can see your point, I think. That sort of option does seem a bit more aligned with what I think users of the official globalprotect client do, albeit with being able to specify a default on the command-line. The option you describe could be better for users who know the portal FQDN and the gateway name, but not the gateway FQDN. I don't know the globalprotect side of things very well, but as a user exploring the behavior client-side, I think that would be more difficult to implement. If we auth to the portal, then we still need to auth to whatever the gateway we choose afterward. I think gp-saml-gui would need to:
Maybe support for much of this already exists, though, and I could be off in my understanding. |
@dlenski can you please provide some guidance on this? I understand that an automatic solution would be ideal, but unless any of us see a way to implement that, I think think that a simple option as implemented in this PR should be acceptable. Thanks, |
839a7e8
to
fa809fe
Compare
I rebased and fixed a typo in the notification message. @dlenski when you have time, can you please check this? As I mention above, I am advocating that this simple solution be provided, unless and until we have a means to do the proper thing automatically. Thanks, |
For some gateway configurations, gp-saml-gui prints a message: IMPORTANT: During the SAML auth, you were redirected from [...] gp-saml-gui uses the target of the redirect, but this is not always correct. Add an option to direct gp-saml-gui to ignore the redirect. Signed-off-by: Daniel Lenski <dlenski@gmail.com>
fa809fe
to
4efb84b
Compare
Nice, thank you! |
For some gateways, we get a message from gp-saml-gui: IMPORTANT: During the SAML auth, you were redirected from [...]
gp-saml-gui uses the target of the redirect, but this is not always correct. Add an option to direct gp-saml-gui to ignore the redirect.