Defining administrator messages from MobileFirst Operations Console - ibm-mobilefirst

Hi I am Defining administrator messages from MobileFirst Operations Console for access disabled in mobilefirst 8.0.
Is there any way to change header of the message alert box like we can change message? Now its "Application Disabled". I want to change this.

See this documentation topic: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/translation/#cordova-applications
You should be able to find the corresponding variable for the header of the dialog in the messages.json file. The file is available after the application has been built.
Android: [Cordova-project]\platforms\android\assets\www\plugins\cordova-plugin-mfp\worklight\messages
iOS, Windows: [Cordova-project]\platforms[ios or windows]\www\plugins\cordova-plugin-mfp\worklight\messages
The variable to look for is this:
"applicationDenied" : "Application Disabled",
You will then need to override it in your applicative code.
For example:
WL.ClienMessages.applicationDenied = "Sorry!";
Should work...

Related

How to access UWP application settings set by MDM?

I am using EnterpriseModernAppManagement CSP to install and set settings for some UWP app as defined here:
https://msdn.microsoft.com/en-us/library/windows/hardware/dn904956(v=vs.85).aspx
.../PackageFamilyName/AppSettingPolicy/SettingValue (only for
./User/Vendor/MSFT) Added in Windows 10, version 1511. The
SettingValue and data represent a key value pair to be configured for
the app.
UWP app installs correctly and settings setup (via AppSettingPolicy) execute successfully.
But how do I now access those custom settings inside the app itself with c#?
Both Windows.Storage.ApplicationData.Current.LocalSetting.Values and Windows.Storage.ApplicationData.Current.RoamingSettings.Values key/value pairs seem empty and unaffected by MDM changes.
Is there any way to send arbitrary settings/configuration to a custom UWP application via MDM?
Apparently, new container is created in app's local settings after AppSettingPolicy key value pairs are pushed via EnterpriseModernAppManagement CSP.
Values can be accessed via:
ApplicationData.Current.LocalSettings.Containers["Managed.App.Settings"].Values
It would be nice if this was documented somewhere! :)

Pass URL with Notifying

I am wondering if it possible to configure the remote notify option to pass a URL.
I see there is a function for onErrorRemoteDisableDenial. I tried to modify it, but it seems to disables the app. Even if i put code to continue, the next call to the backend does not work.
But what we are looking for is giving the user the option to update via URL, or just continue with the app version they currently have.
Using Worklight 6.1
There is a way to customize both Remote Disable and Remote Notify, but the downloadLink (the link that you've set in Worklight Console) is available only when setting Remote Disable, not Remote Notify. Only the message (the text set in Worklight Console) will be available.
You can customize the Remote Notify flow by using the following in main.js (outside of any function):
wl_remoteDisableChallengeHandler.handleChallenge = function(message,downloadLink) {
WL.SimpleDialog.show(
"New Version",
message,
[
{text: "Download", handler: function() {
// Maybe use WL.App.openURL(downloadLink) to go to the app store
}},
{text: "Close", handler: function() {
// Continue with the app
}}
]);
};
wl_remoteDisableChallengeHandler.handleChallenge overrides the default Remote Notify code path. wl_remoteDisableChallengeHandler.handleFailure will override the default Remote Disable code path (and this is another way to customize Remote Disable).
Edit: per the findings in the comments, in order to get both the message and downloadLink, you will first need to temporary set Remote Disable and then change to Remote Notify, this is a workaround because Remote Notify by default is not meant to also pass the downloadLink to the default provided dialog.
Note: Remote Notify is meant to be displayed only once per a message's life cycle, so after it was displayed - it will not be displayed again until a the message is set again in the console.
A way to get the code to work on each application launch is to clear the application's HTML local storage (at some point while the app is running), where a "flag" is stored to tell the application not to display the message again (I forgot its name, but you could print the contents of the local storage and debug that).
Sounds like a nice feature request: https://developer.ibm.com/mobilefirstplatform/help

Can I ignore CWWKS3005E messages on worklight server logs?

I have an application running on Worklight 6.1 and I am seeing this messages on the log.
CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available
I don't need to authenticate the users on my application, can I ignore this message?
I'm not sure, but you can try to cancel logging for this specific package using following log configuration in server.xml:
<logging traceSpecification="XXX.XXX.*=off=disabled"/>
where XXX.XXX.* is the package where the error was occurred.
Here is a list of all available log levels: http://www-01.ibm.com/support/knowledgecenter/SSCKBL_8.5.5/com.ibm.websphere.nd.doc/ae/utrb_loglevel.html
I understand that you are not asked how to remove these messages from the log file, but you asked should you worry about these messages.
Anyway this log is not of Worklight server, it generated by Liberty server. It means you have something wrong in server configuration.
I found that this messages is because my server.xml configuration file of WebSphere Liberty Profile contains this feature
appSecurity-1.0
And I am not defining any User Registry.
http://pic.dhe.ibm.com/infocenter/rsahelp/v8r5/topic/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_feat.html
I am not running the Application Center in this profile and I am securing the Worklight console using properties in the worklight.properties file.
So, the question is can I remove the appSecurity feature?
Add <basicRegistry></basicRegistry> to your server.xml.

IBM Worklight - Error while validating project during deployment

I have created an application using IBM worklight and i am using customAuthenticator for login process
I am getting following validation error while deploying application
Security test DummyAdapter-securityTest must include user and device
realms for AuthDemo:iphone:1.0:api. [project
module_23_1_CustomLoginModule]
You need to re-read the entire Getting Started section about Authentication and Security. There is more reading material here and here.
From the error I am thinking you have added a securityTest="DummyAdapter-securityTest" attribute to your iphone element in application-descriptor.xml.
As noted by the name of the securityTest, it is not meant for the application but for the adapter. This securityTest is already defined for the adapter procedure in the adapter XML file. Remove the securityTest you've added and it will work.
The sample you are trying to run (module_23_1_CustomLoginModule) is ready-made; no need for editing. You need only to build & deploy and run it.

IBM Worklight 5.0.x - How to use console API for automation?

I'm looking for examples to control Worklight appclications via REST API for automation. What I need is a method to disable and enable specific application from command line.
I've found "HTTP Interface of the production server" on the IBM Worklight Information Center, but it doesn't work.
For exapmle, I sent a GET request to:
<WorklightServerURL>/worklight/console/api/getApplications
In return I got:
Error 404: Could not find resource for relative : /getApplications of
full path:
/worklight/console/api/getApplications".
Looking into the Worklight Console interactions using Chrome developer tool, disabling application request generates:
<WorklightServerURL>/worklight/console/api/applications/setAccessRule/17
Which is not consistent with the IBM Worklight Information Center...
This looks to be a documentation defect, where (in this specific case):
http://myhost:port/console/api/{Action}
Should be
http://myhost:port/console/api/applications/{Action}
For example:
http://myworklightserver:8080/console/api/applications/all
http://myworklightserver:8080/console/api/applications/get/testapp
I have opened a documentation defect to update the Console API Requests section. Thanks.
As for setAccessRule,
The API request structure is: http://myworklightserver:8080/console/api/applications/setAccessRule
The parameters are:
gadgetAppId (Required. You can find this in the database)
action (Required. delete | notify | block)
message (Required)
downloadLink (Optional)
Note that you are linking to the Worklight 5.0.5 Information Center; the fixes will appear in the Worklight 5.0.6 and 6.0 Information Center pages.
In Worklight 6.0 the port has changed to "10080", and a context root section exists before "/console".
http://myworklightserver:10080/mycontext/console/api/applications/all