Sign in with a Username and Password
Sign in with a Username and Password

Sign in with a Username and Password

This intent is used to sign in a user to the
PTT Pro for Android
with a user name and password in a shared device environment.
There are two ways to sign in using this intent:
  • Include
    user_name
    and
    user_pwd
    in the
    login_info
    JSON parameter or specify them as separate extra strings. This method of logging in requires a previous configuration of the key fields (For example;  
    key_user_name
    ,
    key_user_pwd
    ) with provisioning configuration.
  • Include
    user_name
    and
    user_pwd
    in the
    login_info
    JSON parameter.

Prerequisites

  • The user must have signed out of the
    PTT Pro for Android
    .
  • The minimum required
    PTT Pro for Android
    version is 3.3.10187.
  • This intent is supported for Zebra devices using ESN OAuth login for a shared device environment.
    • The device’s ESN must be configured in the
      PTT Pro Server
      .
    • The user must be configured in the
      PTT Pro Server
      .
    • OAuth authorization information must be configured in the
      PTT Pro Server
      .
  • This intent is not applicable to
    PTT Pro for Android
    running in a Profile Manager environment.
  • PTT Pro Data Consent page shall be approved or bypassed before issuing this intent. For more information, refer to the Bypass Data Consent.
  • PTT Pro Client service must be already running.
  • After signing out, it is recommended to wait 10 seconds or more before signing in again.

Intent Definition

Name
Description
Action
com.symbol.wfc.pttpro.ACTION_LOGIN
Intent Type
broadcast
Extra 0
This extra specifies the username. This is a mandatory parameter if the
login_info
parameter is not included.
         Type
String
         Name
user_name
         Value
Username with domain (For example;
sample.user@domain
)
Extra 1
This extra specifies the user password. This is a mandatory parameter if the
login_info
 parameter is not included.
         Type
String
         Name
user_pwd
         Value
User Password
Extra 2
This extra specifies if the JSON login information is encrypted. This is an optional parameter.
         Type
Boolean
         Name
json_encrypted
         Value
True indicates the login information is encrypted. False or absent indicates the information is not encrypted.
Extra 3
This extra
login_info
specifies the JSON login information. See below for the payload definition. This extra may or may not be encrypted.
Extra 3  - sent unencrypted
This extra specifies the JSON login information when not encrypted. This is an optional parameter.
                        Type
String
                        Name
login_info
                        Value
String in JSON format
Extra 3 – sent encrypted
This extra specifies the JSON login information when encrypted. This is an optional parameter.
                        Type
Byte array
                        Name
login_info
                        Value
See code snippet
Extra values can be provided in any order.

ADB Examples

Sending user_name and user_pwd as separate extras:
adb shell am broadcast -a com.zebra.dfs.ACTION_LOGIN --es user_name --es user_pwd --es <other login parameters>
Sending login_info unencrypted:
adb shell am broadcast -a com.zebra.dfs.ACTION_LOGIN –es json_encrypted false--es login_info {user_name:sample.user@domain, user_pwd:<password>}

login_info payload

The
login_info
parameter contains JSON formatted data with the following fields:
{"user_name": "username", //mandatory "user_pwd": "userpwd", //mandatory "package": "<third_party_package_name>" //optional; }

PTT Pro for Android
Configurations

The following optional parameters can be applied only once to the
PTT Pro for Android
. For more information about configuring the
PTT Pro for Android
, refer to the Load Configuration File.
Config String
Description
Type
Default
secret_key
<Optional> This value is used to decrypt the login_info when ACTION_LOGIN intent is sent with json_encrypted= true. key length must be 32 characters or UUID where
PTT Pro for Android
accepts 36 characters and remove the "-" character.
For example: "5ecded3e-9562-11ea-bb37-0242ac130002" is converted as "5ecded3e956211eabb370242ac130002"
String
""
key_domain
<Optional> If this value is configured, the domain name is added to the "user_name".
For example; testuser3 becomes testuser3@pttpro if key_domain is configured as "pttpro".
String
""
key_user_name
<Optional> Used with third-party launcher apps. This tag identifies the Username ID attribute and allows input on the current login web page. Sample HTML: """<input id=
userNameInput
name="UserName" type="email" class="text fullWidth" value="">""" 
String
"userNameInput"
key_user_pwd
<Optional> Used with third-party launcher apps. This tag identifies the Password ID attribute and provides input on the current login web page. Sample HTML:"""<input id=
passwordInput
name="Password" type="password" class="text fullWidth" placeholder="Password" autocomplete="off">""" 
String
"submitButton"
key_submit
<Optional> Used with third-party launcher apps. This tag identifies the Submit ID attribute for acceptance of credentials on the current login web page. Sample.html: """ <button id=
submitButton
type="submit" disabled="" tabindex="0" width="1" kind="primary">""" 
String
"submitButton"

ADB Examples

There are two ways to log in to the
PTT Pro for Android
through intent using either ADB commands or an external application.
If "key_domain" is not configured.:
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_LOGIN --es user_name 'testuser3@pttpro' --es user_pwd 'pwdFor2022!' com.symbol.wfc.pttpro
If "key_domain" is configured with "pttpro":
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_LOGIN --es user_name 'testuser3' --es user_pwd 'pwdFor2022!' com.symbol.wfc.pttpro
Sending login_info unencrypted:
If "key_domain" is not configured.
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_LOGIN --ez json_encrypted false --es login_info '{"user_name":"testuser3@pttpro", "user_pwd":"pwdFor2022!"}' com.symbol.wfc.pttpro
If "key_domain" is configured with "pttpro"
adb shell am broadcast -a com.symbol.wfc.pttpro.ACTION_LOGIN --ez json_encrypted false --es login_info '{"user_name":"testuser3", "user_pwd":"pwdFor2022!"}' com.symbol.wfc.pttpro

Encyrption/Decryption

Encryption and decryption of the
login_info
parameter is accomplished using the Google Tink Library at //github.com/google/tink. Following is a sample code to accomplish encryption and decryption.
Code Snippet:
String aad = ""; String secret_key = "5ecded3e-9562-11ea-bb37-0242ac130002"; //Example: UUID // Encryption JSONObject data = new JSONObject(); data.put("user_name", "testuser3@pttpro"); data.put("user_pwd", "pwdFor2022!"); data.put("package", "com.example.launcherapp"); AesGcmJce agjEncryption = new AesGcmJce(secret_key.getBytes()); byte[] encrypted = agjEncryption.encrypt(data.toString().getBytes(), aad.getBytes()); //send encryped data Intent intent = new Intent("com.symbol.wfc.pttpro.ACTION_LOGIN"); intent.putExtra("login_info", encrypted); intent.putExtra("json_encrypted", true); intent.setPackage("com.symbol.wfc.pttpro"); sendBroadcast(intent);
The
secret_key
must be configured to encrypt/decrypt the
login_info
. If the PTT Pro Client does not have the
secret_key
or
json_encrypted
=
false
, it does not decrypt the information.
A sample source code project showcasing some of the APIs and configuration methods described in this document is available on request.