         } else if (self.oauth2Session.refreshToken != nil && self.oauth2Session.refreshTokenIsNotExpired()) {
             // need to refresh token
             self.refreshAccessToken(completionHandler)
-        } else if (self.config.isServiceAccount) {
-            self.loginClientCredentials() { (accessToken, claims, error) in
-                completionHandler(accessToken, error)
-            }
         } else {
             // ask for authorization code and once obtained exchange code for access token
             self.requestAuthorizationCode(completionHandler)

            }
        }
    }
    
    /**
     Request to refresh an access token.
     
     :param: completionHandler A block object to be executed when the request operation finishes.
     */
    public func refreshAccessToken(completionHandler: (AnyObject?, NSError?) -> Void) {
        if let unwrappedRefreshToken = self.oauth2Session.refreshToken {
            var paramDict: [String: String] = ["refresh_token": unwrappedRefreshToken, "client_id": config.clientId, "grant_type": "refresh_token"]
            if (config.clientSecret != nil) {
                paramDict["client_secret"] = config.clientSecret!
            }
            
            http.POST(config.refreshTokenEndpoint!, parameters: paramDict, completionHandler: { (response, error) in
                if (error != nil) {
                    if (error?.code == 400 || error?.code == 401 || error?.code == 403 || error?.code == 404) {
                        self.revokeLocalAccess()
                    }
                    
                    completionHandler(nil, error)
                    return
                }
                
                if let unwrappedResponse = response as? [String: AnyObject] {
                    let accessToken: String = unwrappedResponse["access_token"] as! String
                    let expiration = unwrappedResponse["expires_in"] as! NSNumber
                    let exp: String = expiration.stringValue
                    
                    self.oauth2Session.saveAccessToken(accessToken, refreshToken: unwrappedRefreshToken, accessTokenExpiration: exp, refreshTokenExpiration: nil)
                    
                    completionHandler(unwrappedResponse["access_token"], nil);
                }
            })
        }
    }
    
    /**
     Exchange an authorization code for an access token.
     
     :param: code the 'authorization' code to exchange for an access token.
     :param: completionHandler A block object to be executed when the request operation finishes.
     */
    public func exchangeAuthorizationCodeForAccessToken(code: String, completionHandler: (AnyObject?, NSError?) -> Void) {
        var paramDict: [String: String] = ["code": code, "client_id": config.clientId, "redirect_uri": config.redirectURL, "grant_type":"authorization_code"]
        

    }
    
    /**
    Gateway to provide authentication using the Authorization Code Flow with OpenID Connect.
    
    :param: completionHandler A block object to be executed when the request operation finishes.
    */
    public func login(completionHandler: (AnyObject?, OpenIDClaim?, NSError?) -> Void) {
        
        self.requestAccess { (response:AnyObject?, error:NSError?) -> Void in
