         })
     }
     
+    public class func authenticateWithProvider(provider: String,
+                                               accessToken: String,
+                                               accessSecret: String,
+                                               callback: (response: CloudBoostResponse)->()) throws {
+        
+        if(CloudApp.appID == nil){
+            throw CloudBoostError.AppIdNotSet
+        }
+        
+        let data: NSMutableDictionary = [
+            "key": CloudApp.appKey!,
+            "provider": provider.lowercaseString,
+            "accessToken": accessToken,
+            "accessSecret": accessSecret
+        ]
+
+        let url = CloudApp.getApiUrl() + "/user/" + CloudApp.getAppId()! + "/loginwithprovider"
+        
+        CloudCommunications._request("POST", url: NSURL(string: url)!, params: data, callback: {
+            (response: CloudBoostResponse) in
+          
+            callback(response: response)
+        })
+    }
+    
     /**
      *
      * Log out

            (response: CloudBoostResponse) in

            if response.success || response.status == 400 {
                // Cleanup current user
                let def = NSUserDefaults.standardUserDefaults()
                def.removeObjectForKey("cb_current_user")
            }
            
            // return callback

        
    }
    
    public class func removeCurrentUser() {
        
        let def = NSUserDefaults.standardUserDefaults()
        def.removeObjectForKey("cb_current_user")
    }
    
}