-
Notifications
You must be signed in to change notification settings - Fork 130
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
2FA: Failed to parse server response #109
Comments
Thanks, @antt1v. Lord, I hate GlobalProtect. All the GlobalProtect VPNs I've seen until now deliver their challenge prompts in the form of a JavaScript blob (yes, JavaScript): https://github.com/dlenski/openconnect/blob/HEAD/gpst.c#L129-L200
… but now you're telling me that there are some GlobalProtect VPNs which respond in a (relatively) saner format with XML:
What can you tell me about the GlobalProtect server? What version of GP is the server running? |
Thanks for taking the time to look into this! Yeah, GlobalProtect is... quite terrible. Unfortunately I don't have access to the server itself so I don't know all the details. I assume the server version is one of these two as they're inside the server response after a successful authentication:
I tried the fix in 077c420 and now the challenge response is parsed succesfully and I receive the portal config after enterting the challenge token. However, after that when trying to contact the gateway, it reports authentication failure and goes right back to the challenge prompt:
Re-entering the token pin (or the password) seems to do nothing. Here's the full output:
|
When logging in via the portal interface, the current behavior is (a) do the portal login and (b) if the portal login succeeds, reuse the same credentials from the portal form to attempt to login to the gateway. The problem here, I think, is that the credentials being reused are those of the 2FA challenge login (username, token code, inputStr) rather than the "original" login (username, password). Is that a correct statement? What happens if you skip the portal entirely, and just connect to https://gateway1.vpn.domain.com/gateway? There are very few cases I've seen where the portal login is actually necessary or desirable… and they mainly involve weird external web-based authentication mechanisms.
Yeah …
|
27c5568 should fix this, though it will require you to re-enter the original password again for the gateway. I really need to clean up the GP form handling, but the problem is that I don't know all the possible weird things that can happen, such as this one :( |
Ah, that makes perfect sense. You are correct.
Great idea, that worked perfectly! I have some trouble with the DNS server behind the VPN not being used, but I'm guessing that's more likely due to my local setup rather than skipping the portal. I'll work it out. Other than that, no issues. For the record, the challenge prompt from the gateway was in JavaScript, not XML like from the portal.
I gave this a try but no luck. The inputStr got screwed up and it goes back to the challenge prompt. Here's the result:
In any case I'm personally fine skipping the portal and using the gateway. Thanks for the help! :) If you do choose to continue improving the form handling I'd be happy to test any changes. |
🤦♂️ Internal consistency is not one of the strong points of the GP authentication flow. And that's the nicest possible thing I could say about it.
I see what I screwed up in my haste. Will fix tomorrow. |
I can confirm that the portal authentication now works at least for me. Basically everything is done twice, first with the portal and then with the gateway. The authentication prompts are:
Not the prettiest, but it works! Thanks! :) |
Great, thanks for filling me in!
Yeah, that's what I expected 🙁. I assume that when you do this with the official client, the portal passes off some kind of "portal authentication cookie" to prevent the gateway from having to redo the login and challenge. Except for (4): it re-prompts you for the username? That's not supposed to happen. I wrote a quick-and-dirty GlobalProtect server "simulator" and used it to test this scenario, and at least with the simulator it does not reprompt for username… |
Ah, my bad! Step 4 doesn't actually happen, just the passwords. |
Problem description
I stumbled on a problem with a GlobalProtect VPN server using 2FA where openconnect doesn't understand the challenge response. Produced as follows:
Operating system and openconnect-gp version
openconnect-gp version:
operating system:
Thanks in advance!
The text was updated successfully, but these errors were encountered: