The Device Enrollment Program (DEP) server token is only valid for a year (365 days). Therefore, you need to renew it and update the WSO2 IoT Server's iOS platform configurations with the new token.
Generating the public key
The public key you generated when Adding the WSO2 EMM Solution to the DEP Portal is configured to expire in a year. Therefore, you need to generate a new public key in the Create a new directory to generate the public key. Create a file named Copy the code given below to the Navigate into the directory and run the commands given below in the given order. Now, you see the Follow the steps given below to generate the new DEP server token from the DEP portal: Navigate to the Apple Deployment Programs. Note! Do not close this browser session until you are done configuring the DEP portal. If you do close the browser session, you need to enter the verification code again and start configuring the DEP portal from where you stopped. Sign in with your organization's Apple credentials. Click Get Started to automate the Mobile Device Management (MDM) enrollment. Click on the server you created for WSO2 IoT Server's EMM solution. Click Replace Key and upload the .pem
format.openssl.cnf
in the directory you just created.openssl.cnf
and save it.[ v3_req ]# Extensions to add to a certificate request
basicConstraints=CA:TRUE
keyUsage = digitalSignature, keyEncipherment
[ v3_ca ]
# Extensions for a typical CA
# PKIX recommendation.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
basicConstraints = critical,CA:true
# So we do this instead.
#basicConstraints = CA:true
# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
keyUsage = digitalSignature, keyCertSign, cRLSign
openssl genrsa -out dep_private.key 4096
openssl req -new -key dep_private.key -out dep.csr
openssl x509 -req -days 365 -in dep.csr -signkey dep_private.key -out dep.crt -extensions v3_ca -extfile ./openssl.cnf
openssl x509 -in dep.crt -out dep.pem
dep.pem
file created in the directory you created.Generating the new DEP server token
The DEP portal screen appears.
.pem
file you just generated.
An encrypted Apple server token file in the .
p7m
file format downloads. Make sure to save it in a convenient location.
Updating WSO2 IoT Server with the token
Follow the steps given below to update the token details in the WSO2 IoT Server:
Navigate to the folder where you saved the Apple server token you downloaded when Adding the WSO2 EMM Solution to the DEP Portal via the terminal.
Decrypt the server token using the command given below:
openssl smime -decrypt -in "<THE-.PM7-TOKEN-SERVER-FILE-NAME>.pm7" -inkey "dep_private.key" > token.json
You see the
token.json
file created in the same directory.Start WSO2 IoT Server's core profile.
cd <IOTS_HOME>/bin ./iot-server.sh
- Sign in by entering the EMM administrators username and password. The default username is
admin
and the default password isadmin
. - Click the icon > CONFIGURATION MANAGEMENT > PLATFORM CONFIGURATIONS > iOS Configurations.
- Scroll down until you come to DEP only configurations.
Update the DEP related details:
Agent App ID You are able to enroll and iOS device with WSO2 IoT Server's EMM solution, with or without the agent.
If you are not using the agent, you can leave this section blank.
If you are using the agent, follow the steps given below:
Before you begin!
- Download Xcode and install it.
- Configure WSO2 IoT Server to install iOS mobile applications:
- Open the
<IOTS_HOME>/conf/app-manager.xml
file. Add
%https%
as the value for theAppDownloadURLHost
property.<Config name="AppDownloadURLHost">%https%</Config>
- Open the
- Download the iOS agent source code.
For more information on the agent version related to the IoT Server version you are using, see WSO2 IoT Server and Agent Compatibility. - Build and export the project as an iOS application using Xcode. This will generate an
ipa
file. - Sign in to WSO2 IoT Server's App Publisher console:
https://<IOTS_SERVER_HOST>:9443/publisher
.
The default username isadmin
and the default password isadmin
, and the defaultIOTS_SERVER_HOST
islocalhost
. - Create a new application and upload the
ipa
file you just generated. - Once the application is created, click on the application.
- Note down the App ID from the URL.
Example:https://172.20.10.12:9443/publisher/asset/mobileapp/667026af-2ed4-426f-95c3-246a5707db66
- Enter the App ID as the value for Agent App ID.
Consumer Key Open the token.json
file you just generated and enter the value given for theconsumer_key
here.Consumer Secret Enter the value given for the consumer_secret
in thetoken.json
file.Access Token Enter the value given for access_token
in thetoken.json
file.Access Secret Enter the value given for access_secre
t in thetoken.json
file, here.Access Token Expiry Enter the value given for access_token_expiry
in thetoken.json
file, here.- Click Save.