docs: function discover () {
    var self = this
  
    // construct the uri
    var uri = url.parse(this.issuer)
    uri.pathname = '.well-known/openid-configuration'
    uri = url.format(uri)
  
    var requestOptions = {
      url: uri,
      method: 'GET',
      json: true,
      agentOptions: self.agentOptions
    }
    if (self.proxy) {
      requestOptions.proxy = self.proxy
    }
    // return a promise
    return new Promise(function (resolve, reject) {
      request(requestOptions)
        .then(function (data) {
          // data will be an object if the server returned JSON
          if (typeof data === 'object') {
            self.configuration = data
            resolve(data)
            // If data is not an object, the server is not serving
            // .well-known/openid-configuration as expected
          } else {
            reject(new Error('Unable to retrieve OpenID Connect configuration'))
          }
        })
        .catch(function (err) {
          reject(err)
        })
    })
  }