title: didReceive Challenge Authentication Method Not Called
body: <p>Following is my code . I am trying to use didReceive challenge method for authentication. Apple documents says that  If a session task requires authentication, and there are no valid credentials available, then 'didReceive challenge' method is called. but in this case it is not being called. Any advice will be appreciated. Thanks :)</p>
  
  <pre><code>func getServerResponse(){
      var request=URLRequest(url: URL(string: "http://dev.example.com/Api/Account")!)
      let configuration=URLSessionConfiguration.default
      request.httpMethod="GET"
      let task=URLSession.init(configuration: configuration).dataTask(with: request, completionHandler: {(data,response,error) -&gt; Void in
  
          do {
              if let jsonResult = try JSONSerialization.jsonObject(with: data!, options: []) as? NSDictionary {
                  print("Result--&gt;\(jsonResult)")
                  print((response as! HTTPURLResponse).statusCode)
              }
          } catch let error as NSError {
              print(error.localizedDescription)
          } 
      })
  
      task.resume()
  
  }
  
  func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -&gt; Void) {
      let crdential = URLCredential.init(user:"userName", password: "password", persistence: URLCredential.Persistence.none)
      completionHandler(URLSession.AuthChallengeDisposition.useCredential, crdential)
  
  }
  </code></pre>