The experience with openurl/OPEN_URL has shown that just sending
a URL to a client is not enough and we often need different
behaviour of the client depending on circumstances. Replace
OPEN_URL with a more flexible WEB_AUTH pending auth method.
Patch v2: use WEB_AUTH instead WEBAUTH
Patch v3: incooperate other comments from Selva
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20210813115542.2794-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22737.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
| ... | ... |
@@ -645,11 +645,11 @@ Before issuing a client-pending-auth to a client instead of a |
| 645 | 645 |
client-auth/client-deny, the server should check the IV_SSO |
| 646 | 646 |
environment variable for whether the method is supported. Currently |
| 647 | 647 |
defined methods are crtext for challenge/response using text |
| 648 |
-(e.g., TOTP), openurl and proxy_url for opening a URL in the client to |
|
| 649 |
-continue authentication. A client supporting the first two methods would |
|
| 650 |
-set |
|
| 648 |
+(e.g., TOTP), openurl (deprecated) and webauth for opening a URL in |
|
| 649 |
+the client to continue authentication. A client supporting webauth and |
|
| 650 |
+crtext would set |
|
| 651 | 651 |
|
| 652 |
- setenv IV_SSO openurl,crtext |
|
| 652 |
+ setenv IV_SSO webauth,crtext |
|
| 653 | 653 |
|
| 654 | 654 |
The variable name IV_SSO is historic as AUTH_PENDING was first used |
| 655 | 655 |
to signal single sign on support. To keep compatibility with existing |
| ... | ... |
@@ -668,33 +668,50 @@ notification as |
| 668 | 668 |
where {EXTRA} is formatted as received from the server.
|
| 669 | 669 |
Currently defined formats for {EXTRA} are detailed below.
|
| 670 | 670 |
|
| 671 |
-openurl |
|
| 672 |
-======== |
|
| 671 |
+webauth and openurl |
|
| 672 |
+=================== |
|
| 673 | 673 |
For a web based extra authentication (like for |
| 674 | 674 |
SSO/SAML) {EXTRA} should be
|
| 675 | 675 |
|
| 676 | 676 |
OPEN_URL:url |
| 677 | 677 |
|
| 678 |
-and client should ask the user to open the URL to continue. |
|
| 678 |
+or |
|
| 679 |
+ |
|
| 680 |
+ WEB_AUTH:flags:url |
|
| 681 |
+ |
|
| 682 |
+The OPEN_URL method is deprecated as it does not allow to send flags which |
|
| 683 |
+proved to be needed to signal certain behaviour to the client. |
|
| 684 |
+ |
|
| 685 |
+The client should ask the user to open the URL to continue. |
|
| 679 | 686 |
|
| 680 | 687 |
The space in a control message is limited, so this url should be kept |
| 681 | 688 |
short to avoid issues. If a longer url is required a URL that redirects |
| 682 |
-to the longer URL should be sent instead. |
|
| 689 |
+to the longer URL should be sent instead. The total length is limited to 1024 |
|
| 690 |
+bytes which includes the INFO_PRE:WEB_AUTH:flags. |
|
| 691 |
+ |
|
| 692 |
+flags is a list of flags which are separated by commas. Currently defined |
|
| 693 |
+flags are: |
|
| 694 |
+ |
|
| 695 |
+- proxy (see next pargraph) |
|
| 696 |
+- hidden start the webview in hidden mode (see openvpn3 webauth documentation) |
|
| 697 |
+- external Do not use an internal webview but use an external browser. Some |
|
| 698 |
+ authentication providers refuse to work in an internal webview. |
|
| 699 |
+ |
|
| 683 | 700 |
|
| 684 | 701 |
A complete documentation how URLs should be handled on the client is available |
| 685 | 702 |
in the openvpn3 repository: |
| 686 | 703 |
|
| 687 | 704 |
https://github.com/OpenVPN/openvpn3/blob/master/doc/webauth.md |
| 688 | 705 |
|
| 689 |
-proxy_url |
|
| 690 |
-======== |
|
| 691 |
-This is a variant of openurl that allows opening a url via an |
|
| 706 |
+webauth with proxy |
|
| 707 |
+================== |
|
| 708 |
+This is a variant of webauth that allows opening a url via an |
|
| 692 | 709 |
HTTP proxy. It could be used to avoid issues with OpenVPN connection's |
| 693 | 710 |
persist-tun that may cause the web server to be unreachable. |
| 694 |
-The client should announce proxy_url in its IV_SSO and parse the |
|
| 695 |
-PROXY_URL message. The format of {EXTRA} in this case is
|
|
| 711 |
+The client should announce proxy in its IV_SSO and parse the |
|
| 712 |
+proxy flag in the WEB_AUTH message. The format of {EXTRA} in this case is
|
|
| 696 | 713 |
|
| 697 |
- PROXY_URL:<proxy>:<proxy_port>:<proxyuser_base64>:<proxy_password_base64>:url |
|
| 714 |
+ WEB_AUTH:proxy=<proxy>;<proxy_port>;<proxy_user_base64>;<proxy_password_base64>,flags:url |
|
| 698 | 715 |
|
| 699 | 716 |
The proxy should be a literal IPv4 address or IPv6 address enclosed in [] to avoid |
| 700 | 717 |
ambiguity in parsing. A literal IP address is preferred as DNS might not be |
| ... | ... |
@@ -573,7 +573,7 @@ OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_op |
| 573 | 573 |
* auth_pending_file is |
| 574 | 574 |
* line 1: timeout in seconds |
| 575 | 575 |
* line 2: Pending auth method the client needs to support (e.g. openurl) |
| 576 |
- * line 3: EXTRA (e.g. OPEN_URL:http://www.example.com) |
|
| 576 |
+ * line 3: EXTRA (e.g. WEBAUTH::http://www.example.com) |
|
| 577 | 577 |
* |
| 578 | 578 |
* In addition the OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER and |
| 579 | 579 |
* OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER_V2 are called when OpenVPN tries to |