---
sourceDocument: Yokohama Mobile Configuration and Navigation
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/mobile

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Mobile Configuration and Navigation

ft:clusterId :

    - mobile

bundleId :

    - mobile

workflow :

    - evelopment, Data and Analytics


---

# Advanced app allowance example script

# Advanced app allowance example script {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Users with the admin role can use the example JSON script to configure a scripted
extension point. Admins can use these scripted extension points to limit which mobile apps
can log in to ServiceNow instances. These scripts can also be used to
specify a redirect link to authorized mobile apps.

## Example script {#adv-app-allow-sample-script__section_xx4_rgm_xrb}

The following example script blocks all apps except the Mobile Agent app and the Now Mobile app.

All other apps are restricted. This script also uses the
blocked_mobile_apps_redirect property. When an end user
attempts to log in with an unauthorized app, an error message appears with a
redirect button. That button redirects the end user to log in to a mobile app that
is authorized to connect to the ServiceNow instance.

    var CustomPreAuthProperties = Class.create(); 
    CustomPreAuthProperties.prototype = { 
        initialize: function() {}, 

        /** 
         * Returns a JSON object keyed by the custom property names. 
         */ 
        getProperties: function(input) { 
            var customProperties = {}; 
            if (input.clientType == "agent") { 
                customProperties['allowed_mobile_apps'] = 'com.servicenow.fulfiller'; 
                if (input.deviceType == 'android') { 
                    customProperties['blocked_mobile_apps_redirect'] =  
    				'https://play.google.com/store/apps/details?id=com.servicenow.fulfiller&hl=en_US&gl=US'; 
                } else { 
                    customProperties['blocked_mobile_apps_redirect'] =  
    				'https://apps.apple.com/us/app/servicenow-agent/id1446951408'; 
                } 
            } else if (input.clientType == 'request') { 
                customProperties['allowed_mobile_apps'] = 'com.servicenow.requestor'; 
                if (input.deviceType == 'android') { 
                    customProperties['blocked_mobile_apps_redirect'] =  
    				'https://play.google.com/store/apps/details?id=com.servicenow.requestor&hl=en_US&gl=US'; 
                } else { 
                    customProperties['blocked_mobile_apps_redirect'] =  
    				'https://apps.apple.com/us/app/now-mobile/id1469616608'; 
                } 
            } 

            return customProperties; 
        }, 

        type: 'CustomPreAuthProperties' 
    };

This sample script uses the following JSON objects:

* `input.clientType` which determines the mobile app type.
* `input.deviceType` which determines the operating system type.
{#adv-app-allow-sample-script__ul_fb4_5wg_xrb}

