Skip to content

Add 'GP_' prefix to environment variables #1

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Specify the GlobalProtect server URL (portal or gateway) and optional arguments.

This script will pop up a [GTK WebKit2 WebView](https://webkitgtk.org/) window.
After you succesfully complete the SAML login via web forms, the script will output
`HOST`, `USER`, and `COOKIE` variables in a form that can be used by
`GP_HOST`, `GP_USER`, and `GP_COOKIE` variables in a form that can be used by
[OpenConnect](http://www.infradead.org/openconnect/juniper.html)
(similar to the output of `openconnect --authenticate`):

Expand All @@ -54,12 +54,12 @@ SAML response converted to OpenConnect command line invocation:
echo 'blahblahblah' |
openconnect --protocol=gp --user='[email protected]' --usergroup=prelogin-cookie:gateway --passwd-on-stdin vpn.company.com

$ echo $HOST; echo $USER; echo $COOKIE
$ echo $GP_HOST; echo $GP_USER; echo $GP_COOKIE
https://vpn.company.com/gateway:prelogin-cookie
[email protected]
blahblahblah'

$ echo "$COOKIE" | openconnect --protocol=gp -u "$USER" --passwd-on-stdin "$HOST"
$ echo "$GP_COOKIE" | openconnect --protocol=gp -u "$GP_USER" --passwd-on-stdin "$GP_HOST"
```

TODO
Expand Down
4 changes: 2 additions & 2 deletions gp-saml-gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def parse_args(args = None):
quote(un), quote(server), quote(fullpath), quote(cn), quote(cv)), file=stderr)

varvals = {
'HOST': quote('https://%s/%s:%s' % (server, shortpath, cn)),
'USER': quote(un), 'COOKIE': quote(cv),
'GP_HOST': quote('https://%s/%s:%s' % (server, shortpath, cn)),
'GP_USER': quote(un), 'GP_COOKIE': quote(cv),
}
print('\n'.join('%s=%s' % pair for pair in varvals.items()))