OAuth v2 APK upload
The knox_configure_library_upload_app action uses OAuth unless you explicitly
select legacy mode. Create a Cloud App in Samsung Knox Cloud Apps and provide
its client ID and secret through Fastlane secrets or environment variables.
The default scope is kc.application:manage.
lane :upload_internal_app do
knox_configure_library_upload_app(
client_id: ENV.fetch('KNOX_CLIENT_ID'), # store these in your CI secret store
client_secret: ENV.fetch('KNOX_CLIENT_SECRET'),
app_file_path: ENV.fetch('KC_APP_FILE_PATH'),
app_description: 'Internal Android application'
)
end
OAuth mode accepts client_id, client_secret, optional space-separated
scope, app_file_path, and optional app_description. Environment names
are KNOX_CLIENT_ID, KNOX_CLIENT_SECRET, KNOX_SCOPE, KC_APP_FILE_PATH,
and KC_APP_DESCRIPTION. The file must be a readable APK. The default scope
is kc.application:manage.
The action requests a client-credentials token from the global Knox endpoint, then uploads the actual APK bytes as multipart data to the global Configure v2 in-house application endpoint. The description is sent as a query parameter. No manual multipart boundary is needed.
The returned application ID and status describe processing. InProgress is
accepted but is not ready to deploy. Deployable is successful. Failed
raises an upload failure with the application ID. The action does not poll,
cache or renew tokens, or skip duplicate binaries. OAuth failure does not
trigger legacy authentication.
Upgrading from 0.1.x
Version 1.0.0 is a breaking release. In 0.1.x the action always used the
regional JWT flow. In 1.0.0 it uses OAuth unless auth_mode: 'legacy' is set,
and OAuth mode rejects legacy options instead of ignoring them.
A 0.1.x lane that passes credential_key or credential_path,
clientIdentifierJwtToken, and api_region fails on 1.0.0 with
OAuth cannot be mixed with legacy credentials or region. The same happens
when those options come from environment variables such as
KNOX_CREDENTIAL_KEY or KC_API_REGION. Choose one path:
- Move to OAuth (recommended): create a Cloud App with the
kc.application:managescope, passclient_idandclient_secret, and remove every legacy option and environment variable from the lane. - Stay on legacy for now: add
auth_mode: 'legacy'to the existing call and keep the legacy options. See Explicit legacy mode.
# 0.1.x
knox_configure_library_upload_app(
credential_key: ENV['KNOX_CONFIGURE_CREDENTIAL_KEY'],
clientIdentifierJwtToken: ENV['KNOX_CLIENT_IDENTIFIER_JWT_TOKEN'],
app_file_path: 'app/build/outputs/apk/release/app-release.apk',
api_region: 'EU',
)
# 1.0.0 with OAuth
knox_configure_library_upload_app(
client_id: ENV.fetch('KNOX_CLIENT_ID'),
client_secret: ENV.fetch('KNOX_CLIENT_SECRET'),
app_file_path: 'app/build/outputs/apk/release/app-release.apk',
)
OAuth uses the global Knox API endpoint, so api_region is no longer needed.
Explicit legacy mode
To maintain an existing regional JWT integration, set auth_mode: 'legacy'.
Provide api_region, clientIdentifierJwtToken, and exactly one of
credential_key or credential_path. This retains the legacy request
contract and is not the default. Don't mix OAuth and legacy credentials.
knox_configure_library_upload_app(
auth_mode: 'legacy',
api_region: 'YOUR_REGION',
clientIdentifierJwtToken: ENV.fetch('KNOX_CLIENT_IEDNTIFIER_JWT_TOKEN'),
credential_path: ENV.fetch('KNOX_CREDENTIAL_PATH'),
app_file_path: ENV.fetch('KC_APP_FILE_PATH')
)
The current Configure reference is labeled 26.10 UAT. Local wire tests verify OAuth form fields, binary multipart bytes, and processing status. They do not verify production rollout, Samsung Cloud App entitlement, or successful authentication and upload against a real tenant.