 			"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 {
	

				let url = "https://accounts.google.com/accounts/OAuthLogin?source=hangups&issueuberauth=1"
				let request = NSMutableURLRequest(URL: NSURL(string: url)!)
				request.setValue("Bearer \(access_token)", forHTTPHeaderField: "Authorization")
				
				manager.session.dataTaskWithRequest(request) { data, reponse, error in
					if let error = error { // error case
						print("Request failed with error: \(error)")
					} else {
						var uberauth = NSString(data: data!, encoding: NSUTF8StringEncoding)! as String
						uberauth.replaceRange(Range<String.Index>(
							start: uberauth.endIndex.advancedBy(-1),
							end: uberauth.endIndex
						), with: "")
						
						let request = NSMutableURLRequest(URL: NSURL(string: "https://accounts.google.com/MergeSession")!)
						request.setValue("Bearer \(access_token)", forHTTPHeaderField: "Authorization")
						
						manager.session.dataTaskWithRequest(request) { data, reponse, error in
							if let error = error { // error case
								print("Request failed with error: \(error)")
							} else {
								let url = "https://accounts.google.com/MergeSession?service=mail&continue=http://www.google.com&uberauth=\(uberauth)"
								let request = NSMutableURLRequest(URL: NSURL(string: url)!)
								request.setValue("Bearer \(access_token)", forHTTPHeaderField: "Authorization")
								
								manager.session.dataTaskWithRequest(request) { data, reponse, error in
									if let error = error { // error case
										print("Request failed with error: \(error)")
									} else {
										cb(client: Client(manager: manager))
									}
								}.resume()
							}
						}.resume()
					}
				}.resume()
			}
		} else {
			
