try --authgroup instead of -g
]]>
openconnect -g 1-UASSLClient -u jbenge1 vpn.arizona.edu
Is how I used the command line parameters
]]>Does open connect work with those parameters when used on the command line directly?
You only showed using it interactively, not passing the command line parameters that I've now referred to three times (or is it four). In the second code block you didn't show the command at all. Did you use openconnect's command line options, or did you just add the group to the url?
]]>$ sudo openconnect vpn.arizona.edu
POST https://vpn.arizona.edu/
Connected to IP Address
SSL negotiation with vpn.arizona.edu
Connected to HTTPS on vpn.arizona.edu
XML POST enabled
VPN requires enrollment in NetID+. Enter push, phone, sms, or passcode for
“NETID+Method”
GROUP: [1-UASSLClient|2-Engineering|3-COMVPN|4-COPH|5-Nutrition|6-Communications|7-BIO5|8-UAC|9-Law|Optical Science|UASSL-2Factor]:1-UASSLClient
POST https://vpn.arizona.edu/
XML POST enabled
VPN requires enrollment in NetID+. Enter push, phone, sms, or passcode for
“NETID+Method”
Username:user
Password:
Password:
POST https://vpn.arizona.edu/
Got CONNECT response: HTTP/1.1 200 OK
CSTP connected. DPD 30, Keepalive 20
however trying to pass in group and user as a parameter yields
POST https://vpn.arizona.edu/1-UASSLClient
Connected to 206.207.228.1:443
SSL negotiation with vpn.arizona.edu
Connected to HTTPS on vpn.arizona.edu
XML POST enabled
Invalid host entry. Please re-enter.
I imagine because I am entering the group incorrectly? and I would much rather have a script I was just running out of ideas as well as I imagined a c program is much more scalable should I need more functionality at some point. But again I would much prefer a script or alias
]]>it yields errors in both an alias and a shell script hence the c program for a system call
Then the C code will not work either, it will only be harder to debug.
But what are these errors? Does open connect work with those parameters when used on the command line directly? If so it will work in a script or alias.
]]>Edit: I also have a dual authentication method thus I must enter my password and then the second type of user authentication as a second password
]]>#!/bin/sh
openconnect \
-g $group_name \
-u $user_name \
vpn.arizona.edu
Read the man page for other flags for passwords, certificates, etc.
]]>//here's the general idea
int main()
{
//read in file with users credentials
printf("user %s attempting to connect to University VPN\n", userName);
int connectRC = system("openconnect vpn.arizona.edu"); //here group will be something like 1-UASSLClient or 2-Engineering or Optical Science
// however this is also where we are looking for standard input
//check for nonzero connectRC
}
$ openconnect vpn.service
POST https://vpn.service/
Connected to someIpAddress
SSL negotiation with vpn.service
Connected to HTTPS on vpn.service
XML POST enabled
Group: USER IN #1
Username: USER IN #2
Password: USER IN #3
Password: USER IN #4