Skip to content
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

CAS is not supported by the client #339

Closed
Mirro888 opened this issue Mar 31, 2024 · 20 comments
Closed

CAS is not supported by the client #339

Mirro888 opened this issue Mar 31, 2024 · 20 comments

Comments

@Mirro888
Copy link

Hello all,

gpclient fails connecting to Global Protect with this error:

gpclient::connect] Failed to connect portal with prelogin: Portal prelogin error: Prelogin failed: CAS is not supported by the client. Minimum client version is 6.0

Is there a fix for this issue?

Thank you,

Mirro

@yuezk
Copy link
Owner

yuezk commented Apr 1, 2024

Hi @Mirro888 I would like to support this. There some questions I'd like to know.

1. Does it report the same error when using the GUI client with the external browser?
2. Run the following two commands and paste the output (feel free to redact the sensitive information)

curl -X POST \
  'https://<your vpn portal>/global-protect/prelogin.esp' \
  -d 'prot=https%3A&jnlpReady=jnlpReady&ok=Login&direct=yes&ipv6-support=yes&inputStr=&clientVer=4100'
curl -X POST \
  'https://<your vpn portal>/global-protect/prelogin.esp' \
  -d 'prot=https%3A&jnlpReady=jnlpReady&ok=Login&direct=yes&ipv6-support=yes&inputStr=&clientVer=4100&cas-support=yes'

@yuezk
Copy link
Owner

yuezk commented Apr 1, 2024

@Mirro888 This is the same issue in openconnect https://gitlab.com/openconnect/openconnect/-/issues/651, which is still open and seems hard to fix from the openconnect side.

I'm trying to investigate it deeper, would you mind send the globalprotectcallback payload (the full payload without redaction) to me via the email.

globalprotectcallback:cas-as=1&[email protected]&token=very_long_string

Thanks!

@yuezk
Copy link
Owner

yuezk commented Apr 1, 2024

And which Linux distro are you using? I will send you a test package for testing.

@Mirro888
Copy link
Author

Mirro888 commented Apr 1, 2024

Hello Kevin,

I'm trying to investigate it deeper, would you mind send the globalprotectcallback payload
(the full payload without redaction) to me via the email.

Here is the full payload of globalprotectcallback, received after authentication. Username is changed, but the token is unchanged. The procedure should continue to get an authentication cookie for openconnect. But I have no idea what shall I do with this token.

globalprotectcallback:cas-as=1&un=[email protected]&token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ijk2OjI2OjBGOjhBOjczOkMzOjRGOkY3OjEzOkM2Ojc3OjIwOjhDOjZGOkREOkIzOkNBOkEyOkMzOjg0OkU0OjUyOkYyOkY5OjI3OjdCOjA3OjE0Ojg0OjFFOkQ4OjZGIn0.eyJJblJlc3BvbnNlVG8iOiJiM2IwOTUxZS1lNjYwLTQzZTEtODFkNC1lY2UwMjIzYWFmZTUiLCJhdWQiOiIzNDk5ODMsNDg5NzMxNzUxNDQyOTI3MjA2NCw4MjIyY2IwMS05Yzc4LTRjNDMtODY2MC0xMTExNjk2OWMwYjQsRkxZS1pnQUFBQUF0UVZFOVBVaG1NV2hyUXpNMVZqSmtaMEp0ZDFodkwwbE1aMjVtUTAxeWR6MTFWM3BGWmxaemQyUnBXV2t6TmpCSmRERllRbUZ3UTNSS2IzTnZWVFI2VDBkVVJIVlJVVTVVYlZSSVVUaFNia0pHTldWVVJsWktUbTQ0ZUZGQmJuUjQiLCJVc2VyTmFtZSI6Im1sdXB0YWtAb3BlbnRleHQuY29tIiwiUmVzdWx0Ijp0cnVlLCJBdXRoQ29udGV4dCI6eyJhdXRoX21ldGhvZCI6InNhbWwiLCJtZmFfY2FwYWJsZSI6InRydWUifSwiaWF0IjoxNzExOTc4MDkwLCJleHAiOjE3MTE5NzgxNTB9.Icsx-jF3wmUNkU3ofQNXPIxKPPPAIjamPkumU-LZWjtxKKT6BWEfo3rkVkFlb88M2t4WCLb_9Ml2v_YiE5UONdbL5x5DYodq8aL_wgWuRh3DJKg8J7GKsi3qMt6L6d_EgIG1Np9GIzs7OcbTAtGnkRQcr0ZJgNtIeX3y3myIIlf8g6IjbdIIeZvmx8u6YqR0BtlcNBd0nsGAPkhS6tfoI9HkfcuDQi55zr-Aj3_FZKey_WMFaK1bmvig3k2SEHGycpzf25A2FS0OO6eVE1-3NbSqfEJb8G5vAgYLv1jJjHD-PFFYAH5oQh4dZ618b3Mfdb6-WMJhiVTFZ3bKqY5K-A

@Mirro888
Copy link
Author

Mirro888 commented Apr 1, 2024

Hello Kevin,

And which Linux distro are you using? I will send you a test package for testing.

CentOS and Fedora.

Kind regards,

Mirro

@yuezk
Copy link
Owner

yuezk commented Apr 2, 2024

Hi @Mirro888, I have implemented it to support CAS authentication, but I cannot test it. Can you help test the snapshot package on this page? https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/snapshot

Please uninstall the old one before installing the snapshot package. Thanks.

@Mirro888
Copy link
Author

Mirro888 commented Apr 2, 2024

Hello @yuezk, I've installed the snapshot and executed "gpclient connect ". The "GlobalProtect Login" window opened, I entered the credentials, then the "GlobalProtect Login" window repeatedly displayed "Got invalid token, retrying".
I am attaching the output of the gpclient command and a screenshot.
gp.pdf
gpclient.log

Regards,

Mirro

@yuezk
Copy link
Owner

yuezk commented Apr 3, 2024

Hi @Mirro888, looks like you are using the CLI version. Could you please try the GUI version because the CAS authentication requires using the default browser to authenticate. And currently, only the GUI version support using the default browser (I'm planning to add default browser support to the CLI in the future).

Before launching the GUI, please do the following to ensure the old GUI version is removed, so that the snapshot GUI version can be downloaded at the runtime.

sudo rm /usr/bin/gpgui

@yuezk
Copy link
Owner

yuezk commented Apr 3, 2024

@Mirro888 I found a way to support both the CLI and GUI, you can remove the old package and install the snapshot package again. It should work for both clients, please attach the logs if not. Thanks.

@Mirro888
Copy link
Author

Mirro888 commented Apr 3, 2024

Hello @yuezk, it worked with gpgui and Default Browser. If internal browser is used, then both gpgui and gpclient CLI fail.

What is the option to force gpclient CLI to use the Default Browser?

I am attaching the gpclient.log file.

Kind regards,

Mirro888
gpclient.log

@yuezk
Copy link
Owner

yuezk commented Apr 4, 2024

Hi @Mirro888 glad it worked for GUI. I'm trying to fix the internal browser. The attached gpclient.log only contains the worked logs.

Would you please use the CLI to connect the portal and collect the output? Thanks.

@Mirro888
Copy link
Author

Mirro888 commented Apr 4, 2024 via email

@yuezk
Copy link
Owner

yuezk commented Apr 4, 2024

Hi @Mirro888, thanks for your reply, but the log file seems missing. The gpclient.log you attached yesterday doesn't have the failure logs.

@Mirro888
Copy link
Author

Mirro888 commented Apr 4, 2024

Hi @yuezk, I responded by email, maybe that's the reason the attachment was removed. I am attaching it again via Web.

gp.log

@yuezk
Copy link
Owner

yuezk commented Apr 5, 2024

Hi @Mirro888, thanks for the log. It's an encoding problem and it should be fixed in the latest snapshot release. Could you reinstall the snapshot package and check if it works for the internal browser? Thanks.

@Mirro888
Copy link
Author

Mirro888 commented Apr 5, 2024

Hi @yuezk, it's fantastic, both gpgui and gpclient CLI now work with internal browser!
Great work.
Thanks a lot,
Mirro888

@yuezk
Copy link
Owner

yuezk commented Apr 5, 2024

Hi @Mirro888, thanks for your support, I will release it soon.

@Mirro888
Copy link
Author

Mirro888 commented Apr 7, 2024

Hello @yuezk, I am glad I could help.
Could you add an option to the gpconnect CLI to make it work with Default Browser instead of the internal browser?

@yuezk
Copy link
Owner

yuezk commented Apr 7, 2024

@Mirro888, I plan to support the default browser for CLI in v2.2.0, the upcoming release is v2.1.3, which will include several bug fixes, include this one.

@yuezk
Copy link
Owner

yuezk commented Apr 8, 2024

Hi @Mirro888, 2.1.3 is released. The default browser support for CLI is tracked by #298, I'm closing this.

@yuezk yuezk closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants