Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where i can edit the traccar-web.war to allow traccar manager app work. #759

Open
onethings opened this issue Jul 4, 2016 · 17 comments
Open

Comments

@onethings
Copy link

Hi,
Which file (traccar-web.war ) and code i can edit to allow traccar manager app ( android & ios ) work. Thank you very much.

Android – https://github.com/tananaev/traccar-manager-android
iOS – https://github.com/tananaev/traccar-manager-ios

@vitalidze
Copy link
Owner

The main incompatibility is the password hashing functionality:

  1. Currently Traccar Web UI Mod does not support hashing function from the backend: https://github.com/tananaev/traccar/blob/master/src/org/traccar/helper/Hashing.java#L52

  2. Salt for the backend is generated per user, in my project there is a single salt for the whole application. I believe this is fine for an acceptable level of security.

So, to handle this the following steps must be changed:

  1. Add new hashing function https://github.com/vitalidze/traccar-web/blob/dev/src/main/java/org/traccar/web/shared/model/PasswordHashMethod.java with exactly same algorithm as implemented on the backend with salt from the doHash method argument

  2. Update database.loginUser query:

    <entry key='database.loginUser'>
        SELECT * FROM users
        WHERE email = :email;
    </entry>

It should join the salt column from application_settings table with salt alias. This will force backend to use salt from the global settings.

  1. All users should have email field filled in because backend is using it for the authorization.

For testing here are docs of the backend API: https://www.traccar.org/traccar-api/

These are just my thoughts, I haven't tried it myself.

@rbniranjan
Copy link

Hi Vitaly,

Have you fixed this issue in your new release? or How can I use your rest API in our mobile app.

Hi @onethings

Have you got any solution of this issue. I am also facing same issue.

@vitalidze
Copy link
Owner

No, I haven't fixed that yet.

среда, 13 июля 2016 г. пользователь rbniranjan написал:

Hi Vitaly,

Have you fixed this issue in your new release? or How can I use your rest
API in our mobile app.

Hi @onethings https://github.com/onethings

Have you got any solution of this issue. I am also facing same issue.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#759 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ACMCNWupaaU2JG7iPMI_Snk98lHkK1XEks5qVQOjgaJpZM4JEP3a
.

Kind regards, Vitaly Litvak

@rbniranjan
Copy link

Thanks for your update.

Now I am thinking into another way. I will try to login using your api and then try to use traccar server api. I hope it will work.

@onethings
Copy link
Author

Hi, @rbniranjan
I haven't got solution of this issue yet.

@onethings
Copy link
Author

@rbniranjan i found this android app can login with traccar web ui mod and traccar mod. https://play.google.com/store/apps/details?id=org.erlymon.traccarm
Have you got any solution yet?

@EasywareMX
Copy link

@vitalidze Can you show the correct way to make the add new hashing function with the same algorithm and the query please? I'm lose! XD

@vitalidze
Copy link
Owner

I gave a reference to code in backend project. You need to put it into PasswordHashMethod class somehow.

@rdentandt
Copy link

Hi All

Hope you are well. I am also having this issue. I have VERY limited programming knowledge and am trying to learn. I do however need some guidance as to how to fix this issue? It is quite important to me as I would like to learn to develop on this MOD as it is FANTASTIC!

Please can you guide me on how to get this resolved?

@vitalidze
Copy link
Owner

@rdentandt do you have a particular question? From my point of view all needed information is already present in this ticket.

@rdentandt
Copy link

Hi There

Might be but I am no developer and would some guidance on how to add the doHash commands to the java file before compiling.

Apologies for this but like I said I have no development experience. I am learning so any guidance will be helpful.

Thanks

On 13 Nov 2016, at 3:26 PM, Vitaly Litvak notifications@github.com wrote:

@rdentandt do you have a particular question? From my point of view all needed information is already present in this ticket.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@vitalidze
Copy link
Owner

@rdentandt You need to start from learning java.

vitalidze added a commit that referenced this issue Dec 11, 2016
…dded new password hashing method and user's salt field
@vitalidze
Copy link
Owner

Added basic support, written news, article, updated latest and demo versions.

@ijrad
Copy link

ijrad commented Dec 17, 2016

Hi, I developed a Traccar manager version using hybrid framework (Ionic), it is free and compatible with the UI Mod:
https://play.google.com/store/apps/details?id=com.ionicframework.tracgpsmonitor461755

@EasywareMX
Copy link

EasywareMX commented Dec 27, 2016

# LOVE YOU LITVAK! There changes on new version are awesome! Thank you very much!

@cuantic
Copy link

cuantic commented May 6, 2017

hi,, litvak

i cant add a new user.. in WEB UI 3.9 the log

|Service traccar|17-05-06 19:11:47| ... 52 more
FINEST|1034/0|Service traccar|17-05-06 19:11:47|Caused by: org.h2.jdbc.JdbcSQLException: NULL not allowed for column "NAME"; SQL statement:
FINEST|1034/0|Service traccar|17-05-06 19:11:47|insert into users (id, admin, archive, blocked, companyName, email, expirationDate, firstName, lastName, login, managedBy_id, manager, maxNumOfDevices, notifications, password, password_hash_method, phoneNumber, readOnly, salt, userSettings_id) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23502-194]
FINEST|1034/0|Service traccar|17-05-06 19:11:47| at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)

@vitalidze
Copy link
Owner

@cuantic first of all, please don't post your questions in random threads. I don't see any relation with this thread.

Regarding your issue: this means you haven't followed installation instructions carefully. Most probably you haven't dropped existing database or haven't disabled database schema updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants