     
     func cancel(sender: AnyObject?) {
         dismiss(true, animated: (sender != nil))
+
+        let cancelUrl = NSURL(string: "db-\(DropboxAuthManager.sharedAuthManager.appKey)://2/cancel")!
+        UIApplication.sharedApplication().openURL(cancelUrl)
     }
     
     func dismiss(animated: Bool) {

        super.viewDidLoad()
        self.title = "Link to Dropbox"
        self.webView = WKWebView(frame: self.view.bounds)
        self.view.addSubview(self.webView)
        
        self.webView.navigationDelegate = self

import Security

import Foundation
import SystemConfiguration


/// A Dropbox access token
