Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WSO2 EMM Agent configurations to enroll and manage devices

Table of Contents

...

  1. Create an email account to send out emails to users that register with EMM (e.g., no-reply@foo.com).

  2. Open the <EMM_HOME>/repository/conf/axis2/axis2.xml file, uncomment the mailto transportSender section, and configure the EMM email account.

    Note

    You may need to enable the "Allow less secure apps" option in the Gmail account security settings, to connect account to WSO2 products.

    Code Block
    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
       <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
       <parameter name="mail.smtp.port">587</parameter>
       <parameter name="mail.smtp.starttls.enable">true</parameter>
       <parameter name="mail.smtp.auth">true</parameter>
       <parameter name="mail.smtp.user">synapse.demo.0</parameter>
       <parameter name="mail.smtp.password">mailpassword</parameter>
       <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
    </transportSender>
    Info

    For mail.smtp.frommail.smtp.user, and mail.smtp.password, use the email address, username, and password (respectively) from the mail account you set up.

    Example:

    Code Block
    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
       <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
       <parameter name="mail.smtp.port">587</parameter>
       <parameter name="mail.smtp.starttls.enable">true</parameter>
       <parameter name="mail.smtp.auth">true</parameter>
       <parameter name="mail.smtp.user">foo</parameter>
       <parameter name="mail.smtp.password">$foo1234</parameter>
       <parameter name="mail.smtp.from">no-reply@foo.com</parameter>
    </transportSender>
  3. Configure the email sender thread pool.
    Navigate to the email-sender-config.xml file, which is in the <EMM_HOME>/repository/conf/etc directory, and configure the following fields under <EmailSenderConfig>.

    • MinThreads: Defines the minimum number of threads that needs to be available in the underlying thread pool when the email sender functionality is initialized.

    • MaxThreads : Defines the maximum number of threads that should serve email sending at any given time.

    • KeepAliveDuration : Defines the duration a connection should be kept alive. If the thread pool has initialized more connections than what was defined in MinThreads, and they have been idle for more than the KeepAliveDuration, those idle connections will be terminated

    • ThreadQueueCapacity : Defines the maximum concurrent email sending tasks that can be queued up.

    Example:

    Code Block
    <EmailSenderConfig>
       <MinThreads>8</MinThreads>
       <MaxThreads>100</MaxThreads>
       <KeepAliveDuration>20</KeepAliveDuration>
       <ThreadQueueCapacity>1000</ThreadQueueCapacity>
    </EmailSenderConfig>
  4. Customize the email templates that are in the <EMM_HOME>/repository/resources/email-templates directory. 

    Info

    The email templating functionality of WSO2 EMM is implemented on top of Apache Velocity, which is a free and open-source template engine.

    1. Open the email template that you wish to edit based on the requirement, such as the user-invitation.vm or user-registration.vm file.
    2. Edit the <Subject> and <Body> to suite suit your requirement.
    3. Restart WSO2 EMM.
    Tip

    If you need to access HTTP or HTTPS base URLs of the server within your custom template configs, use the $base-url-http and $base-url-https variables, respectively.

...

The WSO2 EMM administrators can monitor devices by accessing the portal dashboard. Before accessing the dashboard you need to configure the dashboard server to communicate with external OAUTH protected APIs that will be accessed by its gadgets.

  1. Configure <ServerRoles> that is in the <EMM_HOME>/repository/conf/carbon.xml file by adding the CDMFPlatform role.

    Code Block
    <ServerRoles>
       <Role>EMMPlatform</Role>
       <Role>CDMFPlatform</Role>
    </ServerRoles>
  2. Configure the designer.json file that is in the <EMM_HOME>/repository/deployment/server/jaggeryapps/portal/configs directory as follows:

    1. If you have enabled SSO for WSO2 EMM, you need to define sso as the value for activeMethod under authorization else, you can define the activeMethod as basic.

      Info

      For more information on enabling sso, see the WSO2 Dashboard Server documentation on Enabling SSO in WSO2 DS.

      Example:

      Localtabgroup
      Localtab
      titleEnabling SSO authentication

      Configure the following fields:

      • Configure responseSigningEnabled as true.
      • Set the Assertion Consumer (ACS) URL as https://<JAGGERY_APP_HOST>:<JAGGERY_APP_PORT>/portal/acs. In WSO2 EMM the jaggery portal application is available in the product itself. Therefore, you can configure the <JAGGERY_APP_HOST> as localhost and <JAGGERY_APP_PORT> as 9443 if you have not port offset WSO2 EMM.

      Example:

      Code Block
      "authentication":{  
         "activeMethod":"sso",
         "methods":{  
            "sso":{  
               "attributes":{  
                  "issuer":"portal",
                  "identityProviderURL":"https://localhost:9443/samlsso",
                  "responseSigningEnabled":"true",
                  "acs":"https://localhost:9443/portal/acs",
                  "identityAlias":"wso2carbon",
                  "useTenantKey":false
               }
            },
            "basic":{  
               "attributes":{  
      
               }
            }
         }
      }
      Localtab
      titleEnabling basic authentication
      Code Block
      "authentication":{  
         "activeMethod":"basic",
         "methods":{  
            "sso":{  
               "attributes":{  
                  "issuer":"portal",
                  "identityProviderURL":"https://localhost:9443/samlsso",
                  "responseSigningEnabled":"false",
                  "acs":"https://localhost:9444/portal/acs",
                  "identityAlias":"wso2carbon",
                  "useTenantKey":false
               }
            },
            "basic":{  
               "attributes":{  
      
               }
            }
         }
      }
    2. Configure the authorization attributes.

      Code Block
        "authorization":{  
         "activeMethod":"oauth",
         "methods":{  
            "oauth":{  
               "attributes":{  
                  "idPServer":"%https.ip%/oauth2/token",
                  "dynamicClientProperties":{  
                     "callbackUrl":"%https.ip%/portal",
                     "clientName":"portal",
                     "owner":"admin",
                     "applicationType":"JaggeryApp",
                     "grantType":"password refresh_token urn:ietf:params:oauth:grant-type:saml2-bearer",
                     "saasApp":false,
                     "dynamicClientRegistrationEndPoint":"%https.ip%/dynamic-client-web/register/",
                     "tokenScope":"Production"
                  }
               }
            }
         }
      }
      PropertyDescriptionData
      Type 
      Example
      activeMethodDefine the method that needs to be made active from the available authorization methods. In this case you need to define the active mode as OAuth.YesStringOAuth
      idPServer

      Define the Identity Provider URL by replacing %https.ip% with https://<EMM_HOST>:<EMM_PORT>.

      Info

      The default value for <EMM_HOST> is localhost and if you have not port offset WSO2 EMM, the default <EMM_PORT> is 9443.

      YesString
      localhost:9443/oauth2
      /token
      callbackURL

      Define the callback URL by replacing %https.ip% with the https://<EMM_HOST>:<EMM_PORT>.

      Info

      The default value for <EMM_HOST> is localhost and if you have not port offset WSO2 EMM, the default <EMM_PORT> is 9443.

      YesString
      https.ip%/portal
      clientNameDefine the OAuth application name.YesString
      portal
      ownerDefine the username of the owner of the application. In this use case it is the administrator.YesString
      admin
      applicationTypeThe default application type is a jaggery application. If you wish to change it, you need to update this field with the respective application type.YesString
      JaggeryApp
      grantTypeIn this use case, out of the six OAuth 2.0 grant types WSO2 EMM uses the password refresh_token and the saml2-bearer grant types. You can add more grant types as space separated values. If you configured WSO2 EMM for SSO authentication, the saml2-bearer grant type will be used and if you configured WSO2 EMM for basic authentication, the password refresh_token grant type will be used.YesString
      password
      saasAppDefine if this application is a Software as a Service (SaaS) application or not, by defining true or false as the respective values.YesBooleanfalse

      dynamicClientRegistrationEndPoint

      Define the dynamic client registration endpoint by replacing %https.ip% with the https://<EMM_HOST>:<EMM_PORT>.

      Info

      The default value for <EMM_HOST> is localhost and if you have not port offset WSO2 EMM, the default <EMM_PORT> is 9443.

      YesString
      %https.ip%/dynamic-client
      -web/register/
      tokenScopeDefine the scope of the issued access token. It is used to limit the authorization granted to the client by the resource owner.YesString
      Production
  3. Optionally, if you configured the authentication method as sso, you need to register the portal application as a service provider. Fore more information, see the WSO2 Dashboard Server documentation on configuring SSO in DS.

...