Let's take a look at the tasks that Chris, the IoT Server administrator of MobX, has to do from downloading WSO2 IoT Server to registering the iOS device of Alex, the device owner.
...
Tip | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
|
...
- Open the
<IoT_HOME>/core/repository/conf/app-manager.xml
file. Add
%https%
as the value for theAppDownloadURLHost
property.Code Block <Config name="AppDownloadURLHost">%https%</Config>
Tip Tip: To test WSO2 IoT Server App management features on Android devices, please use one of the following options:
- Change the value of the
AppDownloadURLHost
property back to HTTP - Continue using HTTPS to install applications on Android devices by Generating a BKS File for Android.
- Change the value of the
...
Go to the WSO2 IoT Server Management Console at
https://<IoT_HOST>:9443/carbon
and log in using admin as the username and password.Tip - The
<IoT_PORT>
is set to 9443 for HTTPS and 9763 for HTTP by default. As you access the IoT Server Management Console over HTTPS, use 9443 in the URL. When the pages appear, the web browser typically displays an "insecure connection" message, which requires your confirmation before you can continue.
Expand title Click here for more information. The IoT Server Management Console is based on the HTTPS protocol, which is a combination of HTTP and SSL protocols. This protocol is generally used to encrypt traffic from the client to server for security reasons. The certificate that it works with is used for encryption only and does not prove the server identity. Therefore, when you try to access the Management Console, you usually get a warning saying that the connection is untrusted. To continue working with this certificate, accept the certificate before accessing the site. If you are using the Mozilla Firefox browser, you have to accept the certificate only at the first time. After that, the certificate gets stored in the browser database and marked as trusted. However, with other browsers, the insecure connection warning might be displayed every time you access the server.
This scenario is suitable for testing purposes, or for running the program on the company's internal networks. If you want to make the Management Console available to external users, you must obtain a certificate signed by a well-known certificate authority, which verifies that the server actually has the name it is accessed by and that the server belongs to the given organization.
- The
- Click Features on the Configure tab.
- Click Add Repository on the Repository Management tab to add the repository to the server.
Fill out the form and click Add. If the Local option is selected for location, unzip the
p2-repo.zip
file that you received via email when obtaining the CSR file and give the path to that directory.
Click the Available Features tab, select the respective repository, and click Find Features. If the Group features by category option is selected by default, deselect it before checking for the available features.
- Select the
IoT Server - iOS Device Management
feature and click Install. - Click Next, accept the license agreement, and click Next to install the features.
Once the features are successfully installed, you will be prompted to restart now or later.
Note Don't click restart now until you have completed step 9 and 10.
Open
<IoT_HOME>/repository/conf/cdm-config.xml
and uncomment theAPNSBasedPushNotificationProvider
that is underPushNotificationProviders
.
For example:Code Block <PushNotificationProviders> <!--<Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.GCMBasedPushNotificationProvider</Provider>--> <Provider>org.wso2.carbon.device.mgt.mobile.impl.ios.apns.APNSBasedPushNotificationProvider</Provider> <Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.MQTTBasedPushNotificationProvider</Provider> <Provider>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.XMPPBasedPushNotificationProvider</Provider> </PushNotificationProviders>
Open the
<IoT_HOME>/core/repository/conf/iot-api-config.xml
file and replacelocalhost
with your IP or hostname.
For example:Code Block <ServerConfiguration> <!-- IoT server host name, this is referred from APIM gateway to call to IoT server for certificate validation--> <Hostname>https://10.10.10.37:9443/</Hostname> <!--End point to verify the certificate--> <VerificationEndpoint>https://10.10.10.37:9443/api/certificate-mgt/v1.0/admin/certificates/verify/</VerificationEndpoint> <!--Admin username/password - this is to use for oauth token generation--> <Username>admin</Username> <Password>admin</Password> <!--Dynamic client registration endpoint--> <DynamicClientRegistrationEndpoint>https://10.10.10.37:9443/dynamic-client-web/register</DynamicClientRegistrationEndpoint> <!--Oauth token endpoint--> <OauthTokenEndpoint>https://10.10.10.37:9443/oauth2/token</OauthTokenEndpoint> <APIS> <ContextPath>/services</ContextPath> </APIS> </ServerConfiguration>
Open the product's startup script based on your OS (i.e.,
wso2server.sh
for Linux/Solaris andwso2server.bat
for Windows), which is in the<IoT_HOME>/core/bin
directory and add the IP addresses or hostname of the respective servers as shown below:Code Block -Diot.core.host="10.10.10.253" \ -Diot.keymanager.host="10.10.10.253" \ -Diot.gateway.host="10.10.10.253" \
Navigate to the
<IoT_HOME>/core/repository/deployment/server/synapse-configs/default/api
directory and replacelocalhost
with your<SERVER_IP>
for the files listed below:admin--IOS-Enrollment-Profile.xml
admin--IOS-Enrollment-Scep.xml
admin--IOS-Enrollment.xml
Go back to the WSO2 IoT Server management console and click Restart Now.
Note title Important Sign out of the device management and the WSO2 IoT Server console before restarting the server.
If you clicked Restart Now previously, you need to restart the WSO2 IoT Server core profile again. Else you will run into errors.
...
- Download the
ios-configurations.zip
file and unzip it to the<IoT_HOME>/core
directory. Run the script you just downloaded to configure the iOS server settings.
Code Block cd <IoT_HOME>/core/ios-configurator ./ios.sh
Enter the requested information when prompted. Be sure to provide the same information you gave when generating the CSR file. For example:
Next, Chris installs the iOS features.
...
- Restart the WSO2 IoT Server core profile and log in to the IoT Server Console at
https://<IoT_HOST>:9443/devicemgt
using admin as the username and password. Click Menu > CONFIGURATION MANAGEMENT > PLATFORM CONFIGURATIONS > iOS Configurations and fill in the form.
MDM Certificate Password
: Give the same password you gave when converting theMDM_APNS
certificate from thepem
to thepfx
format.MDM Certificate Topic ID
: Give the topic ID of the certificate.
Tip Tip: To learn more about each platform setting, hover your mouse pointer over the help tip.
...
Tip | ||
---|---|---|
| ||
Have you run the sample script previously when trying out the Android quick start guide ? If yes, delete the two users alex and chris, the role iotMobileUser and the sample policies that were created for Android, iOS and Windows. |
- Download the WSO2 IoT Server sample pack .
Create a directory named
samples
in the<IoT_HOME>/core
directory and copy the downloaded file to it.Navigate to the samples directory and run the command given below to copy the required content to the quick start guide setup.
Note Stop the core profile before running the commands given below.
Code Block cd <IoT_HOME>/core/samples/mobile-qsg sh copy-files.sh
Restart the core profile.
Code Block cd <IoT_HOME>/core/bin ./wso2server.sh
Run the script you just downloaded to configure the iOS server settings in WSO2 IoT Server.
Code Block cd <IoT_PRODUCT_HOME>/core/samples/mobile-qsg sh mobile-qsg.sh
...
Log out of the IoT Server console and log in using the following credentials:
Enter chris as the username and chrisadmin as the password.- Click LOG IN.
- In the IoT Server console click View under POLICIES.
Click the edit logo that is on the passcode policy for iOS devices.
Update the passcode profile that is already in place by defining the maximum fail attempts as 5, and click CONTINUE.
Info A profile in the context of IoT Server refers to a collection of policies.
If you want to know more about each policy setting, hover your mouse pointer over the help tip.
- The passcode policy that was created for this scenario has the following groups assigned. You can optionally update the groups.
Chris had selected the set user role/s option and then selected the iotMobileuser role from the item list.
Chris had selected Enforce as the action that needs to be carried out when a device has not complied with a policy.
Info The following actions are referred to as non-compliance rules and determine how policies are monitored.
Non-compliance
rulesDescription Enforce Forcefully enforce the policies on the assigned groups. Warning If the assigned groups do not adhere to the given policies, a warning message will be sent.
Monitor If the assigned groups do not adhere to the given policies, the server is notified of the violation without notifying the user, and the administrator can take the necessary actions.
Click CONTINUE.
Optionally, you can update the name and the description of the policy.It is mandatory that the policy is assigned to Alex's mobile device, so Chris clicks SAVE & PUBLISH to make the policy active immediately.
...
- Navigate to the App Publisher using the following URL:
https://<IoT_HOST>:9443/publisher
Enter the username as chris and password as chrisadmin.
- Click Submit for Review for the WSO2Con application.
- Click Approve > Publish.
The WSO2Con application is now available in the app store for device owners like Alex to install on their devices.
...
- Click the menu icon, and then click DEVICE STATISTICS to access the device statistics dashboard.
- The device statistics dashboard is facilitated via the WSO2 Dashboard Server. Therefore, since you have not enabled SSO in this guide for WSO2 IoT Server, you will need to log into the dashboard using chris as the username and chris@IoTS as the password.
Currently, you will not see any data populated in the dashboard as there are no enrolled devices and no non-compliant or unmonitored devices in the system.
...
Sign in to the WSO2 IoT Server device management console using alex as the username and alexuser as the password.
- Click Enroll New Device.
- Click iOS to enroll your device with WSO2 IoTS.
- Enroll the device.
- Click Enroll Device.
Scan the QR code and the Safari browser will display the IoT Server iOS enrollment screen.
After scanning the QR code you will be directed to a web page. When this page appears, the web browser will typically display an "insecure connection" message, which requires your confirmation before you can continue.
- Tap Install IoT Server Certificate. The iOS devices need the root certificate to be downloaded to trust the server certificate.
- The Install Profile screen appears. Tap Install.
- Tap the Skip Agent Installer link at the bottom of the screen.
- On the IoT Server Registration screen, enter your details:
- Username - Enter alex as the username.
- Password - Enter alexuser as the password.
- Domain - You don't need to enter the domain details for this scenario.
Info By default WSO2 IoT Server only supports the "bring your own device" (BYOD) registration process for the iOS platform.
Tap Log In.
After reading the End User License Agreement (EULA), tap I accept the terms.
Tap Install when prompted to install the carbon.super Profile Service.
A warning message appears to indicate that by installing the profile the IoT Server will remotely manage the iOS device. Tap Install.
Tap Trust to confirm that you are aware of the device being remotely managed by installing the profile.
After the profile is installed, click Done.
Upon the successful registration, the DEVICE ADDED confirmation appears.
...
- Access the IoT Server Management Console using alex as username and alexuser as the password.
- Click the icon.
- Click DEVICE MANAGEMENT.
- Click on the registered device.
Alex tries out the various operations on her device via the WSO2 IoT Server Management Console.
Note NOTE: Because we didn't install the WSO2 IoT Server iOS agent while registering the device, the ring device, send notifications, and get device location operations do not function. For more information on installing the agent in the registration process, you can follow the steps in the iOS tutorial.
Info For more information on the available features, Try out the iOS operations.
Tip | ||
---|---|---|
| ||
To know if a policy is applied on your device, see Verifying Policies Applied on an iOS Device. |
...