 ########################
   robot.respond /sensu clients/i, (msg) ->
     validateVars
-    robot.http(config.sensu_api + '/clients')
+    credential = createCredential()
+    req = robot.http(config.sensu_api + '/clients')
+    if credential
+      req = req.headers(Authorization: credential)
+    req
       .get() (err, res, body) ->
         if err
           msg.send "Sensu says: #{err}"

    else
      client = ''

    robot.http(config.sensu_api + '/events' + client)
      .get() (err, res, body) ->
        if err
          msg.send "Sensu says: #{err}"

      msg.send "Please set the HUBOT_SENSU_API_URL environment variable."
      return

createCredential = ->
    username = process.env.HUBOT_SENSU_API_USERNAME
    password = process.env.HUBOT_SENSU_API_PASSWORD
    if username && password
      auth = 'Basic ' + new Buffer(username + ':' + password).toString('base64');
    else
      auth = null
    auth

######################
#### Info methods ####
######################
