summaryrefslogtreecommitdiff
path: root/exports/exports.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-09-27 17:09:44 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2023-09-29 13:31:43 +0200
commit8f784bd0657302977ccc434b4859f37ad59616c9 (patch)
tree188a397be01a8a4b535bfa2c54a3a86b4039babc /exports/exports.go
parentb4f04a2cd7162b3c88f9ac28d5a19d56bbe626aa (diff)
Exports Docs: Improve examples for mobile redirects
Diffstat (limited to 'exports/exports.go')
-rw-r--r--exports/exports.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/exports/exports.go b/exports/exports.go
index d9ae7f3..919b9c8 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -290,8 +290,9 @@ func Deregister() *C.char {
// The following state callbacks are mandatory to handle:
//
// - OAUTH_STARTED: This indicates that the OAuth procedure has been started, it returns the URL as the data.
-// The client should open the webbrowser with this URL and continue the authorization process. Note: For mobile platforms this returns a Cookie and data (json: {"cookie": x, "data": url}).
-// This `url` should also be opened in the browser like desktop platforms. But these platforms also need to reply to the library to give back the full authorization code URI with CookieReply(x, uri) that the apps get back when the user clicks approve. For this, apps need to register an app url or sorts. For the valid values for app URLs, see the redirect URIs for mobile platforms here https://git.sr.ht/~fkooman/vpn-user-portal/tree/v3/item/src/OAuth/VpnClientDb.php
+// The client should open the webbrowser with this URL and continue the authorization process. Note: For mobile platforms this returns a Cookie and data (json: `{"cookie": x, "data": url}`).
+// This `url` should also be opened in the browser like desktop platforms. But these platforms also need to reply to the library to give back the full authorization code URI with `CookieReply(x, uri)`.
+// E.g. `CookieReply(x, "/callback?code=...&state=...&iss=...")` this is the path of the request that the apps get back when the user clicks approve. For this, apps need to register an app url or sorts. For the valid values for app URLs, see the redirect URIs for mobile platforms here https://git.sr.ht/~fkooman/vpn-user-portal/tree/v3/item/src/OAuth/VpnClientDb.php
//
// Example Input (3=custom server):
// ```AddServer(mycookie, 3, "https://demo.eduvpn.nl", 0)```
@@ -544,8 +545,9 @@ func ServerList() (*C.char, *C.char) {
// ### OAUTH_STARTED
//
// - OAUTH_STARTED: This indicates that the OAuth procedure has been started, it returns the URL as the data.
-// The client should open the webbrowser with this URL and continue the authorization process. Note: For mobile platforms this returns a Cookie and data (json: {"cookie": x, "data": url}).
-// This `url` should also be opened in the browser like desktop platforms. But these platforms also need to reply to the library to give back the full authorization code URI with CookieReply(x, uri) that the apps get back when the user clicks approve. For this, apps need to register an app url or sorts. For the valid values for app URLs, see the redirect URIs for mobile platforms here https://git.sr.ht/~fkooman/vpn-user-portal/tree/v3/item/src/OAuth/VpnClientDb.php
+// The client should open the webbrowser with this URL and continue the authorization process. Note: For mobile platforms this returns a Cookie and data (json: `{"cookie": x, "data": url}`).
+// This `url` should also be opened in the browser like desktop platforms. But these platforms also need to reply to the library to give back the full authorization code URI with `CookieReply(x, uri)`.
+// E.g. `CookieReply(x, "/callback?code=...&state=...&iss=...")` this is the path of the request that the apps get back when the user clicks approve. For this, apps need to register an app url or sorts. For the valid values for app URLs, see the redirect URIs for mobile platforms here https://git.sr.ht/~fkooman/vpn-user-portal/tree/v3/item/src/OAuth/VpnClientDb.php
//
// The client should open the webbrowser with this URL and continue the authorization process.
// This is only called if authorization needs to be retriggered