diff --git a/auth.c b/auth.c
index 5634224b..a4f95d68 100644
--- a/auth.c
+++ b/auth.c
@@ -143,6 +143,8 @@ static int parse_auth_choice(struct openconnect_info *vpninfo, struct oc_auth_fo
continue;
form_id = (char *)xmlGetProp(xml_node, (unsigned char *)"value");
+ if (!form_id)
+ form_id = (char *)xmlNodeGetContent(xml_node);
if (!form_id)
continue;
@@ -678,6 +680,7 @@ void free_auth_form(struct oc_auth_form *form)
*
*
*
+ *
*
*/
@@ -793,6 +796,14 @@ static int xmlpost_append_form_opts(struct openconnect_info *vpninfo,
goto bad;
for (opt = form->opts; opt; opt = opt->next) {
+ /* group_list: create a new node under */
+ if (!strcmp(opt->name, "group_list")) {
+ if (!xmlNewTextChild(root, NULL, XCAST("group-select"), XCAST(opt->value)))
+ goto bad;
+ continue;
+ }
+
+ /* everything else: create user_input under */
if (!xmlNewTextChild(node, NULL, XCAST(opt->name), XCAST(opt->value)))
goto bad;
}