Comments (3)
I can reproduce the problem. I am working on a solution, and will update the issue.
from mikrotik-java.
I've fixed it, and the API will now throw an exception if the user tries to log in with a empty (0 length or string full of spaces) username. Empty passwords are valid and are still allowed.
The fix is in the master branch, and I will release v2.0.3 for this bug shortly.
More detail, if you're interested:
The way the Mikrotik API works internally caused this problem. The user side sends a "/login" command, receives a hash, and then sends a second "/login" command using this hash and the username. This overloading of "/login" would have been fine if the Mikrotik side was prepared to handle the situation where a empty username with a valid hash is received. By handle I don't mean accept a blank username, simply return an error. But what they do if the username is empty, is to just return another hash.
So the fix was quite simple:
if (username.trim().isEmpty()) {
throw new ApiConnectionException("API username cannot be empty");
}
Thank you for reporting this. I hope it resolves the issue for you.
Gideon
from mikrotik-java.
Yes, right, thanks!
from mikrotik-java.
Related Issues (20)
- Problem to send profile exchange command HOT 1
- Failure on login with empty pass HOT 1
- Failed to login if password contains = char
- Login fails if the password contains ! (Token.PIPE) HOT 2
- Connecting with API_SSL do not work with RouterOS Stable 6.45.5 version HOT 1
- get users by .id value not work
- Add support for nested query expressions HOT 9
- Failed to login if password contain ! HOT 1
- How to implement Pull Request #67 in Android HOT 2
- unknwon parameter when adding user hotspot profile with on-login script HOT 1
- issue with reading single file from mikrotik router HOT 1
- query with ~ symbol HOT 1
- Get result from /export compact
- [Request] Add Tilde in Scanner.java HOT 1
- New login method of Router OS HOT 1
- Thanks gideon HOT 1
- Mikrotik HOT 1
- Can't connect via ssl
- FOR MIKROTIK
- create-and-activate-profile HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mikrotik-java.