title: Not authorized error connecting Bluemix geospatial service to Watson IoT Platform
body: <p>I have deployed the Bluemix GeoSpatial starter application in Bluemix. </p>
  
  <p>It works fine until I want to connect to the Watson IoT Platform instead of the demo MQTT server.</p>
  
  <p>I changed <code>mqtt1.m2m4connectedlife.com</code> to <code>dzqml6.messaging.internetofthings.ibmcloud.com</code> and added <code>mqtt_uid</code> and <code>mqtt_pw</code> to the start parameters jsonObject.</p>
  
  <p>I created an API key in the Watson IoT Platform Dashboard and used these values for <code>mqtt_uid</code> and <code>mqtt_pw</code>.</p>
  
  <p>Then I get an "Error: Connection refused: Not authorized" in the log when starting the application.</p>
  
  <p>Then I also tried the apiKey and apiToken form the Watson IoT Platform environment variables for <code>mqtt_uid</code> and <code>mqtt_pw</code> but still got the same error.</p>
  
  <p>I also tried different values for clientid and notify/input topics but without success.</p>
  
  <p>I read a couple of other posts with similar errors that were resolved after some time because of a delay between when an organization is created and is distributed to all servers.</p>
  
  <p><a href="https://developer.ibm.com/answers/questions/163862/iot-cloud-error-not-authorized.html" rel="nofollow noreferrer">https://developer.ibm.com/answers/questions/163862/iot-cloud-error-not-authorized.html</a></p>
  
  <p>So I waited a day but still have the same error.</p>
  
  <p>I also added myself as a permanent member to the organization as suggested in this post: <a href="https://stackoverflow.com/questions/33309617/refused-not-authorized-error-occurs-with-ibm-iot-foundation-on-bluemix">Refused: not authorized error occurs with IBM IoT Foundation on Bluemix</a></p>
  
  <p>I would be very gratefull for any assistance on this!</p>