#define XCAST(x) ((const xmlChar *)(x))
+/* XX: some F5 VPNs simply do not have a static HTML form to parse, but
+ * only a mess of JavaScript which creates a dynamic form that's
+ * functionally equivalent to the following:
+ *
+ * <form id="auth_form" method="post">
+ * <input type="text" name="username"/>
+ * <input type="password" name="password"/>
+ * </form>
+ */
static struct oc_auth_form *plain_auth_form(void)
{
struct oc_auth_form *form;
free_auth_form(form);
return NULL;
}
+ if ((form->auth_id = strdup("auth_form")) == NULL)
+ goto nomem;
+
opt = form->opts = calloc(1, sizeof(*opt));
if (!opt)
goto nomem;
PID=$!
wait_server $PID 1
+echo -n "Authenticating with username/password in the absence of an HTML login form... "
+( echo "test" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT --protocol=f5 -q $ADDRESS:443/?no_html_login_form=1 -u test $FINGERPRINT --cookieonly >/dev/null 2>&1) ||
+ fail $PID "Could not receive cookie from fake F5 server"
+
+echo ok
+
echo -n "Authenticating with username/password... "
( echo "test" | LD_PRELOAD=libsocket_wrapper.so $OPENCONNECT --protocol=f5 -q $ADDRESS:443 -u test $FINGERPRINT --cookieonly >/dev/null 2>&1) ||
fail $PID "Could not receive cookie from fake F5 server"
# [Save list of domains/authgroups in the session for use later]
@app.route('/')
def root():
- domains, mock_dtls = request.args.get('domains'), request.args.get('mock_dtls')
+ domains, mock_dtls, no_html_login_form = request.args.get('domains'), request.args.get('mock_dtls'), request.args.get('no_html_login_form')
+ assert not (domains and no_html_login_form), \
+ f'combination of domains and no_html_login_form is not allow specified'
session.update(step='initial-GET', domains=domains and domains.split(','),
- mock_dtls=mock_dtls and bool(mock_dtls))
+ mock_dtls=mock_dtls and bool(mock_dtls),
+ no_html_login_form = no_html_login_form and bool(no_html_login_form))
# print(session)
return redirect(url_for('get_policy'))
@app.route('/my.policy')
def get_policy():
session.update(step='GET-login-form')
+ no_html_login_form = session.get('no_html_login_form')
+ if no_html_login_form:
+ return '''<html><body>It would be nice if F5 login pages consistently used actual HTML forms</body></html>'''
+
domains = session.get('domains')
sel = ''
if domains: