docs: function getIdentity (hubhost, hubport) {
    debug('retrieve identity by logging in as guest')
  
    // guest@x.com / guest
    // guest@connect.logitech.com/gatorade
    var deferred = Q.defer()
    var iqId
  
    var xmppClient = new Client({
      jid: 'guest@x.com/gatorade',
      password: 'guest',
      host: hubhost,
      port: hubport,
      disallowTLS: true,
      reconnect: true
    })
  
    xmppClient.on('online', function () {
      debug('XMPP client connected')
  
      var body = 'method=pair:name=harmonyjs#iOS6.0.1#iPhone'
      var iq = util.buildIqStanza(
        'get', 'connect.logitech.com', 'vnd.logitech.connect/vnd.logitech.pair',
        body, 'guest')
  
      iqId = iq.attr('id')
  
      xmppClient.send(iq)
    })
  
    xmppClient.on('error', function (e) {
      debug('XMPP client error', e)
      xmppClient.end()
      deferred.reject(e)
    })
  
    xmppClient.on('stanza', function (stanza) {
      debug('received XMPP stanza: ' + stanza)
  
      if (stanza.attrs.id === iqId.toString()) {
        var body = stanza.getChildText('oa')
        var response = util.decodeColonSeparatedResponse(body)
  
        if (response.identity && response.identity !== undefined) {
          debug('received identity token: ' + response.identity)
          xmppClient.end()
          deferred.resolve(response.identity)
        } else {
          debug('could not find identity token')
          xmppClient.end()
          deferred.reject(new Error('Did not retrieve identity.'))
        }
      }
    })
  
    return deferred.promise
  }