 
     public static func authorize(completion: CompletionClosure) {
         precondition(isInitialized)
+        precondition(settings.redirectURI != nil)
+
         state = .Authorizing(completion)
         let request = Authorize(
             client_id: settings.clientId,
-            redirect_uri: settings.redirectURI,
+            redirect_uri: settings.redirectURI!,
             scope: Scope.scopesToRaw(settings.scopes))
         let param = URLEncodedSerialization.stringFromDictionary(request.parameters)
         let base = request.baseURL.absoluteString

    }

    public static func isRedirectURL(url: NSURL) -> Bool {
        let absurl = url.absoluteString
        return absurl.hasPrefix(settings.redirectURI)
    }
    public static func authorizationDone(URL url: NSURL) -> Bool {
        switch state {

internal struct DeveloperSettings {
    let clientId: String
    let clientSecret: String
    let scopes: [Scope]
    let redirectURI: String?

    internal init(clientId: String, clientSecret: String, scopes: [Scope] = [], redirectURI: String? = nil) {
        self.clientId = clientId
        self.clientSecret = clientSecret
        self.scopes = scopes
        self.redirectURI = redirectURI
    }
}

