         return components.URL!
     }
     
+    private func dAuthURL(nonce: String?) -> NSURL {
+        let components = NSURLComponents()
+        components.scheme =  "dbapi-2"
+        components.host = "1"
+        components.path = "/connect"
+        
+        if let n = nonce {
+            let state = "oauth2:\(n)"
+            components.queryItems = [
+                NSURLQueryItem(name: "k", value: self.appKey),
+                NSURLQueryItem(name: "s", value: ""),
+                NSURLQueryItem(name: "state", value: state),
+            ]
+        }
+        return components.URL!
+    }
+    
     private func canHandleURL(url: NSURL) -> Bool {
-        return (url.scheme == self.redirectURL.scheme
-            &&  url.host == self.redirectURL.host
-            &&  url.path == self.redirectURL.path)
+        for known in [self.redirectURL, self.dauthRedirectURL] {
+            if (url.scheme == known.scheme &&  url.host == known.host && url.path == known.path) {
+                return true
+            }
+        }
+        return false
     }
     
     /// Present the OAuth2 authorization request page by presenting a web view controller modally

    /// :param: controller
    ///         The controller to present from
    public func authorizeFromController(controller: UIViewController) {
        let web = DropboxConnectController(
            URL: self.authURL(),
            tryIntercept: { url in
                if self.canHandleURL(url) {
                    UIApplication.sharedApplication().openURL(url)
                    return true
                } else {
                    return false
                }
            }
        )
        
        let navigationController = UINavigationController(rootViewController: web)
        controller.presentViewController(navigationController, animated: true, completion: nil)
    }
    
    
    /// Try to handle a redirect back into the application
    ///

    }
}

private let kDBLinkNonce = "dropbox.sync.nonce"

/// The result of an authorization attempt.
///
/// - `Success` - The authorization succeeded. Includes a `DropboxAccessToken`.
