 			"redirect_uri": "urn:ietf:wg:oauth:2.0:oob",
 		]
 		
-		// MANAGER DATATASK + JSON
-		Alamofire.request(.POST, OAUTH2_TOKEN_REQUEST_URL, parameters: token_request_data).responseJSON { response in
-			switch response.result {
-			case .Success(let JSON):
-				cb(access_token: JSON["access_token"] as! String, refresh_token: JSON["refresh_token"] as! String)
-			case .Failure(let error):
+		// Make request first.
+		let req = NSMutableURLRequest(URL: NSURL(string: OAUTH2_TOKEN_REQUEST_URL)!)
+		req.HTTPMethod = "POST"
+		req.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type")
+		req.HTTPBody = query(token_request_data).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
+		
+		// Execute the request.
+		NSURLSession.sharedSession().dataTaskWithRequest(req) { data, reponse, error in
+			if let error = error { // error case
 				print("Request failed with error: \(error)")
+			} else {
+				do {
+					let JSON = try NSJSONSerialization.JSONObjectWithData(data!, options: .AllowFragments)
+					cb(access_token: JSON["access_token"] as! String, refresh_token: JSON["refresh_token"] as! String)
+				} catch {
+					print("Request failed with error: \(error)")
+				}
 			}
-		}
+		}.resume()
 	}
 	
 	/**

import Cocoa
import CommonCrypto

/* TODO: Replace with OAuth2 framework. */

public class OAuth2 {
	

				"refresh_token": refresh_token,
			]
			
			// Make request first.
			let req = NSMutableURLRequest(URL: NSURL(string: OAUTH2_TOKEN_REQUEST_URL)!)
			req.HTTPMethod = "POST"
			req.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type")
			req.HTTPBody = query(token_request_data).dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
			
			manager.session.dataTaskWithRequest(req) { data, reponse, error in
				if let error = error { // error case
					print("Request failed with error: \(error)")
				} else {
					do {
						let JSON = try NSJSONSerialization.JSONObjectWithData(data!, options: .AllowFragments)
						print("got \(JSON)")
						cb(access_token: JSON["access_token"] as! String, refresh_token: refresh_token)
					} catch {
						print("Request failed with error: \(error)")
					}
				}
			}.resume()
	}
	
	public class func authenticateClient(cb: (client: Client) -> Void, auth: Authenticator) {
