Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/custom-app-scheme] Custom app/auth schemes #1060

Merged
merged 13 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions doc/BUILD_CUSTOMIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Build Flags

## Description

Build Flags can be used to control the inclusion or exclusion of certain functionality or features.

## Usage in Branding

A space-separated list of flags can be specified in the `Branding.plist` with the key `build.flags`, f.ex.:

```xml
<key>build.flags</key>
<string>DISABLE_BACKGROUND_LOCATION</string>
```

## Flags

The following options can be used as `build.flags`:

### `DISABLE_BACKGROUND_LOCATION`

Removes the following from the app:
- the option for location-triggered background uploads from Settings
- the location description keys from the app's `Info.plist`

Not used by default.

### `DISABLE_APPSTORE_LICENSING`

Removes the following from the app:
- App Store integration for OCLicense
- App Store related view controllers and settings section


# Custom Schemes

## Description

The app uses two URL schemes:
- `oc` for authentication
- `owncloud` for private links

Both schemes are part of the app's `Info.plist`, which can only be changed at build time.

## Usage in Branding

### Private Links

The default `owncloud` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `build.custom-app-scheme`, f.ex.:

```xml
<key>build.custom-app-scheme</key>
<string>myscheme</string>
```

### Authentication

The default `oc` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `build.custom-auth-scheme`, f.ex.:

```xml
<key>build.custom-auth-scheme</key>
<string>ms</string>
```

The change in the `Info.plist` is only necessary when an external browser is used for authentication via OAuth2 or OIDC. In that case, the scheme must also be changed in the regular options for OIDC and OAuth2 authentication methods:

```xml
<key>authentication-oauth2.oa2-redirect-uri</key>
<string>ms://ios.owncloud.com</string>
<key>authentication-oauth2.oidc-redirect-uri</key>
<string>ms://ios.owncloud.com</string>
```

Depending on OAuth2 and OIDC implementation on the server side:
- it may be necessary to also adapt the registered redirect URI on the server
- authentication could fail if not adapted on the server
120 changes: 117 additions & 3 deletions doc/CONFIGURATION.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
[
{
"autoExpansion" : "none",
"category" : "Account",
"categoryTag" : "account",
"classIdentifier" : "account",
"className" : "ownCloud.ServerListTableViewController",
"defaultValue" : false,
"description" : "Skip \"Account\" screen / automatically open \"Files\" screen after login",
"flatIdentifier" : "account.auto-connect",
"key" : "auto-connect",
"label" : "account.auto-connect",
"status" : "supported",
"type" : "bool"
},
{
"autoExpansion" : "none",
"category" : "Actions",
Expand Down Expand Up @@ -462,6 +476,10 @@
"key" : "browser-session-class",
"label" : "authentication.browser-session-class",
"possibleValues" : [
{
"description" : "Replace `http` with `awb` and `https` with `awbs` to delegate browser sessions to the AirWatch browser.",
"value" : "AWBrowser"
},
{
"description" : "Replace http and https with custom schemes to delegate browser sessions to a different app.",
"value" : "CustomScheme"
Expand Down Expand Up @@ -645,6 +663,19 @@
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Branding",
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"description" : "URL to open when selecting the \"Send feedback\" option. Allows the use of all placeholders provided in `http.user-agent`.",
"flatIdentifier" : "branding.send-feedback-url",
"key" : "send-feedback-url",
"label" : "Feedback URL",
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Branding",
Expand Down Expand Up @@ -677,7 +708,7 @@
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"defaultValue" : "https://doc.owncloud.com/ios-app/",
"defaultValue" : "https://doc.owncloud.com/ios-app/latest/",
"description" : "URL to documentation for the app. Opened when selecting \"Documentation\" in the settings.",
"flatIdentifier" : "branding.url-documentation",
"key" : "url-documentation",
Expand Down Expand Up @@ -727,6 +758,19 @@
"status" : "advanced",
"type" : "urlString"
},
{
"autoExpansion" : "none",
"category" : "Branding",
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"description" : "Default values for user defaults. Allows overriding default settings.",
"flatIdentifier" : "branding.user-defaults-default-values",
"key" : "user-defaults-default-values",
"label" : "branding.user-defaults-default-values",
"status" : "advanced",
"type" : "dictionary"
},
{
"autoExpansion" : "none",
"category" : "Browser Session",
Expand All @@ -753,6 +797,47 @@
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"defaultValue" : "owncloud",
"description" : "Name of the URL scheme to use for private links. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.",
"flatIdentifier" : "build.custom-app-scheme",
"key" : "custom-app-scheme",
"label" : "build.custom-app-scheme",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"defaultValue" : "oc",
"description" : "Name of the URL scheme to use for OAuth2/OIDC authentication. Must be provided in Branding.plist at build time. The authentication redirect URI parameters must also be changed accordingly in Branding.plist and on the server side. For documentation, please see doc/BUILD_CUSTOMIZATION.md.",
"flatIdentifier" : "build.custom-auth-scheme",
"key" : "custom-auth-scheme",
"label" : "build.custom-auth-scheme",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"description" : "A set of space separated flags to customize the build. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.",
"flatIdentifier" : "build.flags",
"key" : "flags",
"label" : "build.flags",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Connection",
Expand Down Expand Up @@ -1207,8 +1292,7 @@
"categoryTag" : "connection",
"classIdentifier" : "core",
"className" : "OCCore",
"defaultValue" : 10,
"description" : "Minimum number of seconds until the next scan for changes, measured from the completion of the previous scan.",
"description" : "Minimum number of milliseconds until the next scan for changes, measured from the completion of the previous scan. If no value is provided, uses the poll interval provided in the server's capabilities (in milliseconds) if it is greater or equal 5 seconds. Defaults to 10 seconds otherwise.",
"flatIdentifier" : "core.scan-for-changes-interval",
"key" : "scan-for-changes-interval",
"label" : "core.scan-for-changes-interval",
Expand Down Expand Up @@ -1409,6 +1493,22 @@
"status" : "debugOnly",
"type" : "bool"
},
{
"autoExpansion" : "none",
"category" : "Localization",
"categoryTag" : "localization",
"classIdentifier" : "locale",
"className" : "OCLocaleFilterClassSettings",
"defaultValue" : {

},
"description" : "Dictionary with localization overrides where the key is the English string whose localization should be overridden, and the value is a dictionary where the keys are the language codes (f.ex. \"en\", \"de\") and the values the translations to use.",
"flatIdentifier" : "locale.overrides",
"key" : "overrides",
"label" : "Localization Overrides",
"status" : "advanced",
"type" : "dictionary"
},
{
"autoExpansion" : "none",
"category" : "Logging",
Expand Down Expand Up @@ -1731,6 +1831,20 @@
"status" : "advanced",
"type" : "int"
},
{
"autoExpansion" : "none",
"category" : "Passcode",
"categoryTag" : "passcode",
"classIdentifier" : "passcode",
"className" : "AppLockSettings",
"defaultValue" : false,
"description" : "Controls wether the biometrical unlock will be enabled automatically.",
"flatIdentifier" : "passcode.use-biometrical-unlock",
"key" : "use-biometrical-unlock",
"label" : "passcode.use-biometrical-unlock",
"status" : "advanced",
"type" : "bool"
},
{
"autoExpansion" : "none",
"category" : "Release Notes",
Expand Down
Loading