By default, users authenticate to the Mobile Workspace using Keycloak. To enable other authentication method within Auth0, you must first configure it on the Auth0 server, and then modify the Mobile Workspace app.config.json file to enable logon.
To enable Auth0 authentication method:
-
Configure an authentication on the Auth0 server.
For complete instructions on setting up an authentication on the Auth0 server, see the Auth0 documentation available at https://auth0.com/docs/get-started.
-
Access your server instance running in a Kubernetes cluster using Kubectl or
other tool for managing containerized applications.
For more information on Kubernetes commands, see the official Kubernetes website available at https://kubernetes.io/.
-
Retrieve the list of pods in the acs namespace by entering the
kubectl command.
For the required Kubernetes command, see the get section on the Kubernetes Documentation site at https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands.All the pods in the acs namespace are listed.
-
Copy the app.config.json file from the pod to your local
machine using the kubectl command.
For the required Kubernetes command, see the cp section on the Kubernetes Documentation site at https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands.The app.config.json file is copied from the pod's directory to the local machine's directory.
- Open the saved app.config.json file in a text editor, such as Visual Studio Code.
- Navigate to the end of the app.config.json file's content.
-
Copy the following mobileSettings object and paste it at the
end of the file's content.
"mobileSettings": { "host": "<AuthURL>", "realm": "<RealmName>", "contentServicePath": "<PathtoACS>", "secret": <ClientSecret>, "scope": "<OAuth2Scope>", "audience": <TargetAudience>, "android": { "redirectUri": "<RedirectURI>", "clientId": "<ClientID>" }, "iOS": { "redirectUri": "<RedirectURI>", "clientId": "<ClientID>" } }, -
Depending on the authentication method, modify the values of the following keys
to reflect your authentication configuration.
Key Description "host" Specifies the authentication server URL, for example Keycloak or Auth0. Example for Keycloak: "https://<hostname>", where <hostname> is the name of a host, for example mobileapps.envalfresco.com.
"realm" Specifies the authentication realm or tenant name if required by the identity provider (IDP). Example for Keycloak: "alfresco".
Note: If the selected IDP does not support realms, this key can be omitted."contentServicePath" Specifies the path for accessing Content Services. It is required. Example: "alfresco"
Note: If the selected IDP does not require a Content Services path, this key can be omitted."secret" Specifies the client secret. It is required only if mandated by the IDP; otherwise, it can be omitted or set to null.
"scope" Specifies the OAuth2 scope. It is required. Example: "openid profile email"
"audience" Specifies the target audience. It is required only if mandated by the IDP; otherwise, it can be omitted.
"redirectUri" Specifies the custom redirect URI, which varies depending on the IDP or platform, such as Android or iOS. Example redirect URIs for Android:
- Keycloak: "androidacsapp://aims/auth"
- Auth0: "demo://$host/android/$AppPackage/callback"
Example redirect URIs for iOS:
- Keycloak: "iosacsapp://aims/auth"
- Auth0: "$BundleIdentifier://$host/ios/$BundleIdentifier/callback"
"clientID" The client ID for authentication. It is required for both iOS and Android. - Save the app.config.json file.
-
Copy the app.config.json file from your local machine to
the same pod it was copied from using the kubectl
command.
For the required Kubernetes command, see the cp section on the Kubernetes Documentation site at https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands.The app.config.json file is copied from the local machine to the pod's directory.
- Restart or reload the service for the changes to take effect.
Mobile Workspace uses the AppAuth library for authentication on both iOS and Android. This library enables logon using Keycloak and Auth0.
For more information on the AppAuth library for Android, see https://github.com/openid/AppAuth-Android.
For more information on the AppAuth library for iOS, see https://github.com/openid/AppAuth-iOS.