     }
 }
 
+private let kDBLinkNonce = "dropbox.sync.nonce"
+
 /// The result of an authorization attempt.
 ///
 /// - `Success` - The authorization succeeded. Includes a `DropboxAccessToken`.

    
    let appKey : String
    let redirectURL: NSURL
    let host: String
    
    

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