title: Request failed: unauthorized (401) with Twitter login
body: <p>I am trying to login with Twitter in my iOS app but I am getting following error:</p>
  
  <pre><code>CredStore - performQuery - Error copying matching creds.  Error=-25300, query={
  class = inet;
  "m_Limit" = "m_LimitAll";
  ptcl = htps;
  "r_Attributes" = 1;
  sdmn = "https://api.twitter.com";
  srvr = "api.twitter.com";
  sync = syna;
  }
  error: Optional("Request failed: unauthorized (401)")
  </code></pre>
  
  <p>My code for login:</p>
  
  <pre><code>Twitter.sharedInstance().logIn(completion: { (session, error) in
          if (session != nil) {
              print("signed in as \(session?.userName)");
  
              let client = TWTRAPIClient(userID: session?.userName)
              client.loadUser(withID: (session?.userID)!, completion: { (user, error) in
  
                  let twitterClient = TWTRAPIClient.withCurrentUser()
                  let request = twitterClient.urlRequest(withMethod: "GET",
                                                         url: "https://api.twitter.com/1.1/followers/list.json?cursor=-1&amp;screen_name=dearestpankaj&amp;skip_status=true&amp;include_user_entities=false",
                                                         parameters: ["include_email": "true", "skip_status": "true"],
                                                         error: nil)
  
                  twitterClient.sendTwitterRequest(request) { response, data, connectionError in
                      print(data!)
                      let s :String = String(data: data! as Data, encoding: String.Encoding.utf8)!
  
                      if let data = s.data(using: String.Encoding.utf8) {
                          do {
                              let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String:Any]
                              print(json!)
  
                          } catch {
                              print("Something went wrong")
                          }
                      }
                  }
              })
  
          } else {
              print("error: \(error?.localizedDescription)");
          }
      })
  </code></pre>
  
  <p>Yesterday this error was intermittent but today I am continuously getting this error.</p>