diff --git a/auth-globalprotect.c b/auth-globalprotect.c index a745c062..f4c45742 100644 --- a/auth-globalprotect.c +++ b/auth-globalprotect.c @@ -401,6 +401,8 @@ static int parse_portal_xml(struct openconnect_info *vpninfo, xmlNode *xml_node, choice->label, choice->name); } } + if (!vpninfo->authgroup && opt->nr_choices) + vpninfo->authgroup = strdup(opt->choices[0]->name); if (vpninfo->write_new_config) { buf_append(buf, " \n\n"); @@ -412,7 +414,7 @@ static int parse_portal_xml(struct openconnect_info *vpninfo, xmlNode *xml_node, /* process auth form to select gateway */ result = process_auth_form(vpninfo, form); - if (result != OC_FORM_RESULT_NEWGROUP) + if (result == OC_FORM_RESULT_CANCELLED || result < 0) goto out; /* redirect to the gateway (no-op if it's the same host) */