 internal struct DeveloperSettings {
     let clientId: String
     let clientSecret: String
-    let redirectURI: String
     let scopes: [Scope]
-
-    internal init(clientId: String, clientSecret: String, redirectURI: String, 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
-        self.scopes = scopes
     }
 }
 

    }

    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 {


    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!,
            scope: Scope.scopesToRaw(settings.scopes))
        let param = URLEncodedSerialization.stringFromDictionary(request.parameters)
        let base = request.baseURL.absoluteString
