Ability for application to determine logged in user - Shared Devices

Every time a user signs into the device and is assigned a profile with our application, we'd like to set the username automatically based on the shared device credentials. Currently, the app is installed through a package and not a managed app. Is this possible through the managed configurations?

Using Android Enterprise & Samsung S10s/S20s.

3 years ago
Android
ANSWERS
RC
Raymond Chan Diamond Contributor
3 years ago

What are the Android firmware version on your device?

What about the version and build numbers of your MobiControl server and device agent?

Could you please do a simple test on your shared device:

1. Log in the device with a valid shared device credential.

2. After successful log-in, send the following legacy script to the device -

     log -i "User Name : %ENROLLEDUSER_USERNAME%"

3. Check the logs tab of the device in your web-console, and verify if there is a log entry showing VALID username associated with the log-in credential just used in step (1).

CS
Chris S
3 years ago

Thanks, Raymond. See below.

What are the Android firmware version on your device? - OS 11

What about the version and build numbers of your MobiControl server and device agent?

  • MobiControl v15.5.2.1003 
  • Agent v15.2.4 Build 1034

I was able to complete the test and a valid username is being logged within the web console after running the script.

RC
Raymond Chan Diamond Contributor
3 years ago

Hi Chris,

With your confirmed successful test result, you should be able to have any AppConfig compliant app notified about the log-in username via your MobiControl v15.5.2 server.

Your AppConfig compliant app should have a key/value pair for this username field, say a string with keyname 'UName", and the value field in the Advanced->Managed-Configuration tab of the app should be set to %ENROLLEDUSER_USERNAME%.  

For Samsung and Zebra devices,  your MobiControl v15.5.2 supports deploying such AppConfig compliant app directly from your MobiControl server rather than from Managed Google Play Store.  Just go to Policies --> Apps pop-up pane, and  add the app with "App Source" field chosen to be "Enterprise".  You can then upload your .apk file, and subsequently configure your AppConfig parameter as described above.

CS
Chris S
3 years ago

Hi Raymond,

Thanks again for the help! Unfortunately, I don't believe our application is AppConfig compliant at this point in time but I'll bring it up with the team to see if we can work that piece in. 

I found another thread (https://discussions.soti.net/discussions/android-plus-device-name-to-text-file)  and ended up using the packaging studio to mimic it using %ENROLLEDUSER_USERNAME% and it seems to be working as intended.

Probably not the best solution but it'll satisfy the requirement until we're able to get the application AppConfig compliant. 

RC
Raymond Chan Diamond Contributor
3 years ago

Hi Chris,

It's good to hear that you have tested that  you can successfully use the trick discussed in the thread

  https://discussions.soti.net/discussions/android-plus-device-name-to-text-file

for your current case.     The minor shortcoming of this simple approach is that the mechanism can be easily impacted (e.g. by malware or device end-user interaction using simple app such as a file manager/explorer) because the file /directory is readable/writable by other apps at any time.

In addition, please bear in mind the trick might need refinement or even not work at all, due to the likely tightening scoped storage limitations (as discussed in https://discussions.soti.net/articles/impact-of-android-11-scoped-storage-restrictions-on-android-agent)  in forthcoming Android versions..

S
SAMOD@SOTI
3 years ago

Hello everyone,

Thank you for posting on SOTI Central. 

Thank you Raymond for your suggested test. Very interesting. 

To perform a similar test, from the SOTI Help (I used MC v 15.6), you can find script used for that test:




Here is where you can find the following Macro: %ENROLLEDUSER_USERNAME%:






From SOTI Help (I used MC v15.6), you have some examples of Macros:

Once done, you can send the script via the Web Console. By checking via the device or from the Web Console (Log tab), you can see if the script has been sent successfully and if a User Name appears.

In my below example, no User Name shows up as I have no connection with a LDAP or IdPs. 



For your information, you can do some testings, by using different macros.

For instance, you could try: 

log -i "IP : %IP%"



If this post has helped you, could you please put it as resolved? 

Thank you.

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

M
Mark
a year ago

I know it's an old thread... but maybe somebody is going to read this.

Can I also get the Last User Login? 

I tried %LAST_USERNAME% and a lot of variations, but can't figure this one out?

Is this possible?

(also the last user login (=timestamp and duration) would be interesting to have.

BR, Mark