     }
 
     public func authorize(username: String, password: String, completion: Result<Void, NSError> -> ()) {
-        authorize(.ResourceOwnerPasswordCredentials(username: username, password: password)) { result in
+        authorize(.ResourceOwnerPasswordCredentials(username, password)) { result in
             completion(result.map { _ in return })
         }
     }

public let HeimdallErrorNotAuthorized = 3

private enum AuthorizationGrant {
    case ResourceOwnerPasswordCredentials(username: String, password: String)
    case Refresh(refreshToken: String)

    private var parameters: [String: String] {
        switch self {

        if let accessToken = accessToken {
            if accessToken.expiresAt != nil && accessToken.expiresAt < NSDate() {
                if let refreshToken = accessToken.refreshToken {
                    authorize(.Refresh(refreshToken)) { result in
                        completion(result.map { accessToken in
                            return self.requestByAddingAuthorizationHeaderToRequest(request, accessToken: accessToken)
                        })
