             return
         }
         
+        guard authenticationStrategy.retries < authenticationStrategy.retriesLimit + 1 else {
+            
+            authenticationStrategy.retries = 0
+            
+            if let task = task {
+                task.cancel()
+            }
+            
+            self.cancelAll()
+            
+            return completionHandler(statusCode: NSURLError.Cancelled.rawValue, data: nil, error: NSError(domain: "", code: 503, userInfo: ["message":"authentication limit reached"]))
+        }
+        
         guard !authenticationStrategy.isRefreshing else {
             
             if let task = task {


public protocol AuthenticationStrategy: class {
    
    var token: String? { get set }
    var authenticationHeader: String { get set }
    var isRefreshing: Bool { get }
    var retries: Int { get }
    
    func refreshToken(completionHandler: (error :NSError?, token: String?) -> Void)
}

        
        guard let statusCode = response.response?.statusCode else {
            
            let error = response.result.error
            
            return completionHandler(statusCode: error?.code, data: response.data, error: error)
        }
        
        switch statusCode {
