This documentation is for WSO2 IoT Server 3.1.0. View the documentation for the latest release.
Page Comparison - Configuring WSO2 IoT Server with a Third Party MQTT Broker (v.15 vs v.16) - IoT Server 3.1.0 - WSO2 Documentation

Versions Compared

Key

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

...

  1. Copy the following code snippet to the TokenValidationService SOAP service of the respective MQTT broker.

    Code Block
    <dependency>
       <groupId>org.wso2.carbon.identity</groupId>
       <artifactId>org.wso2.carbon.identity.oauth.stub</artifactId>
       <version>${carbon.identity.oauth.stub.version}</version>
    </dependency>
    Note

    This will enable enables a client stub to access the TokenValidationService. To check out the existing code implementation, see OAuth2BasedMQTTAuthenticator.java.

  2. Call the DeviceAccessAuthorizationService API, to authorize the client.

    Example:

    Code Block
    curl -X POST https://localhost:8243/api/device-mgt/v1.0/admin/authorization -H 'authorization: Bearer 7e5cad0f-cf78-3981-b50e-db9d674fb741' -H 'content-type: application/json' -d '{"tenantDomain":"carbon.super","username": "ayyoob","deviceIdentifiers":[{"id":123, "type":"firealarm"}]}'
    Note

    To check out the existing code implementation, see DeviceAccessBasedMQTTAuthorizer.java.