 
         self.navigationController?.navigationBar.tintColor = UIColor.black
         self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel,
-            target: self, action: #selector(CLOAuthViewController.cancelAction))
+                                                                 target: self, action: #selector(CLOAuthViewController.cancelAction))
 
         self.webView = WKWebView(frame: self.view.bounds)
-        self.webView?.navigationDelegate = self;
+        self.webView?.navigationDelegate = self
         view.addSubview(webView!)
 
-        var queryStr = self.baseURL + "/oauth/authorize?client_id=\(self.clientId)" + "&scope=\(scope)&response_type=code" 
-        queryStr = queryStr.appendingFormat("&scope=%@", scope)
+        var queryStr = self.baseURL + self.authorizePath + "?client_id=\(self.clientId)" + "&scope=\(scope)&response_type=code"
 
         if let redirectUri = self.redirectUri {
             queryStr = queryStr.appendingFormat("&redirect_uri=%@", redirectUri)

                        "Content-Type": "application/x-www-form-urlencoded",
                        "Accept": "application/json"
                    ]
                    let url = URL(string: self.baseURL + "/oauth/access_token")
                    var request = URLRequest(url: url!, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 60.0)
                    request.allHTTPHeaderFields = headers
                    request.httpMethod = "POST"


    open weak var delegate: CLOAuthViewControllerDelegate?

    public init(baseURL: String, authorizePath: String = "/oauth/authorize", accessTokenPath: String = "/oauth/access_token",
                clientId: String, clientSecret: String, scopes: Array<String>, redirectUri: String) {
        self.baseURL = baseURL
        self.authorizePath = authorizePath
        self.accessTokenPath = accessTokenPath
        self.clientId = clientId
        self.clientSecret = clientSecret
        self.scope = scopes.joined(separator: ",")
