gamonoid / icehrm

Manage your employees easily with a robust and efficient Human Resource Management System
http://icehrm.com
Other
586 stars 373 forks source link

IOS APP login not working because of wrong URL in barcode #187

Open maikst opened 5 years ago

maikst commented 5 years ago

The generated barcode looks like this:

{"key":"IceHrm","url":"/home/tstadmin/public_html/icehrm/app/api/","token":"954ba6a29e32"}

Token is shortened -----------

The URL looks like the base path but not like the base URL.

Because of this a login with the APP is not possible.

Is it possible to change this in the installation by myself or is it an error in the code?

tesalis commented 5 years ago

Error in the code. No working in open source and demo.

alexnogard commented 5 years ago

Same issue. It will be corrected ? Thanks

exilepc commented 5 years ago

The QR code generator uses the CLIENT_BASE_PATH var and not the CLIENT_BASE_URL var, I was unable to get the QR code to work so I decided it and saw that you had my CLIENT_BASE_PATH, not my CLIENT_BASE_URL

{"key":"IceHrm","url":"/home/USERNAME/public_html/hr/app/api/","token":"XXXXXXXXX"}

also the API folder in the index.php

include DIR.'/../config.php';

should just be

include '../config.php';

There is no need to look up the DIR just to go up one DIR, you can just go up one DIR

I have also manually made the QR code with the URL and not the installed path, but I am still getting an error but not the same error as the first QR code.

unnamed

thilinah commented 5 years ago

This is a known issue which will be fixed in the new release.

You can fix it for now by adding following line to your icehrm/app/config.php

define('REST_API_BASE',CLIENT_BASE_URL.'api/');

If the mobile app is still not working, click on the "Login as Another Employee" link below the login button and scan the QR code again.

For further debugging:

Then check the QR code generated by icehrm using a QR code reader in your mobile, and use the token and url in the QR code to access the api manually to check if the api is working.

If you QR code data is like below

{
  "key" : "IceHrm",
  "url" : "https://your-url",
  "token" : "ea2fe3b0ff5386d8868e272e07713cbf"
}

Then you should be able to get a response for

curl -i https://your-url/employees/me -H "Authorization: Bearer ea2fe3b0ff5386d8868e272e07713cbf"

Please make sure the Rest Api is working and URL provided in the QR code is correct Api root. Refer: https://icehrm.gitbook.io/icehrm/part-8/rest-api

Fabiettus commented 4 years ago

Hi to all, i've installed icehrm O.S. on a local LAMP server (not in a root folder) but i'm unable to login with mobile app ("an error occurred while login").

As per https://icehrm.gitbook.io/icehrm/api-and-single-sign-on/rest-api, the response from"http://your-icehrm-url.com/app/api" request is "404"

from "http://your-icehrm-url.com/app/api/employees/me" is:

{ "error": [ [ { "code": 401, "message": "Authorization bearer token not found or invalid" } ] ] } Any advice??

Gangledore commented 4 years ago

I still have the same problem. The REST Api is working correctly, I can get the random number generated with the echo command. The issue seems to be when looking up the bearer token. I keep getting the error "Authorization bearer token not found or invalid". So to me that seems to be saying that the bearer token doesn't exist in the database., I have checked the database using PhpMyAdmin and the tokens exist in the RestAccessTokens table.

I have tried several re-installations of Icehrm all suffer from the same problem. I have even imnported all the employees from the demo instance but none of the ones I have tried work. However, I AM able to login on the mobile app on the demo at http://icehrm-open.gamonoid.com/.

I am using am Ionos shared server LAMP stack.

I really want this to work for me. Any ideas please.

maikst commented 4 years ago

Well, latest Commit is from Aug 2019. problem is not fixed.

Is there still anyone working on this software?

dezarate commented 4 years ago

Hi, still the issue with the new version, but on the documents appear like is fix it, any help with that ? still the issue on the app AN ERROR OCCURRED WHILE LOGin, I add the line ""define('REST_API_BASE',CLIENT_BASE_URL.'api/');"" on the icehrm/app/config.php like @thilinah said but the problem still there

mrcastilla commented 3 years ago

Hi, I still have the same issue, Any new information or solution about that?. Thanks

lrnldlcrz commented 3 years ago

Hi, we just bought this IceHrmPro and also having same issue. I've also tried what @thilinah said. I've also tested some of the APIs and working. Still getting "An error occured while login"

When tried to Login via mobile, is it using API /employees/me ? I tried to test this API (via SoapUI) and able to get good response.

Just want to know if this has been fixed?

Thank you!

thilinah commented 3 years ago

Hi, we just bought this IceHrmPro and also having same issue. I've also tried what @thilinah said. I've also tested some of the APIs and working. Still getting "An error occured while login"

When tried to Login via mobile, is it using API /employees/me ? I tried to test this API (via SoapUI) and able to get good response.

Just want to know if this has been fixed?

Thank you!

Hi, I'm the maintainer of the open-source application. So I suggest you get support by sending an email to team@icehrm.com.

chopperpl commented 2 years ago

so the token generated in API Access is identical to the one in QR, but still above errors pops up and can't connect on Android or IOS.

chopperpl commented 2 years ago

Hi, we just bought this IceHrmPro and also having same issue. I've also tried what @thilinah said. I've also tested some of the APIs and working. Still getting "An error occured while login"

When tried to Login via mobile, is it using API /employees/me ? I tried to test this API (via SoapUI) and able to get good response.

Just want to know if this has been fixed?

Thank you!

@lrnldlcrz were you able to solve this problem? I'm in the same boat :(

maikst commented 2 years ago

Congratulations You invested in a software that is not really maintained

Am 05.10.2021 um 13:24 schrieb chopperpl @.***>:

 Hi, we just bought this IceHrmPro and also having same issue. I've also tried what @thilinah said. I've also tested some of the APIs and working. Still getting "An error occured while login"

When tried to Login via mobile, is it using API /employees/me ? I tried to test this API (via SoapUI) and able to get good response.

Just want to know if this has been fixed?

Thank you!

@lrnldlcrz were you able to solve this problem? I'm in the same boat :(

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

chopperpl commented 2 years ago

Congratulations You invested in a software that is not really maintained I have not invested in it yet. I've been evaluating this for potential purchase by my client, but it seems no one cares about pre-sales support. Too bad, because it was looking good so far and this small glitch (or lack of response) most likely impact the purchase decission :(

ddave001 commented 2 years ago

AFAIK @lrnldlcrz received support and probably managed to receive the issue. The issue might have been related to not using HTTPS for the API.

@maikst seems to be the kind of person who receives software for free and blames the free software for his lack of ability to configure the REST API properly or get paid support :).

@chopperpl I recommend you read the documentation again to see what you are doing wrong.

Specifically, it mentions this:

If IceHrm is not loaded from web root, for an example if your icehrm url is your-icehrm-url.com/icehrm instead of your-icehrm-url.com you should add any directory in relative path to location block as in following example

The example is for nginx. But if you are using Apache you will have to update app/api/.htaccess according to your path.

chopperpl commented 2 years ago

AFAIK @lrnldlcrz received support and probably managed to receive the issue. The issue might have been related to not using HTTPS for the API.

@maikst seems to be the kind of person who receives software for free and blames the free software for his lack of ability to configure the REST API properly or get paid support :).

@chopperpl I recommend you read the documentation again to see what you are doing wrong.

Specifically, it mentions this:

If IceHrm is not loaded from web root, for an example if your icehrm url is your-icehrm-url.com/icehrm instead of your-icehrm-url.com you should add any directory in relative path to location block as in following example

The example is for nginx. But if you are using Apache you will have to update app/api/.htaccess according to your path.

Hello Dave, Thanks for quick reply. I'm aware of your hint. The install is accessed from the root, but instead of extracting all files to public_http I have changed Apache config to use icehrm-x.x.x as root. Apache was restarted and permissions fixed... I will try again, but in case it is not working is it possible to get from you paid support to get this eval going??? Thanks

ddave001 commented 2 years ago

Also, you can check if your apache config supports allow override to make sure app/api/.htaccess is respected.

<Directory /var/www/>
        Options Indexes FollowSymLinks
        **AllowOverride All** 
        Require all granted
</Directory>

We don't provide paid support through the open-source project. You may get paid support via icehrm.com if you have an active license for IceHrmPro.

chopperpl commented 2 years ago

I’m afraid I have those directives already...

<Directory /system-path/public_html/icehrm_v30.0.0.OS>
Options -Indexes +FollowSymLinks +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php7.4
FCGIWrapper /home/adamjaniec/domains/lukasz.adamjaniec.com/fcgi-bin/php7.4.fcgi .php
FCGIWrapper /home/adamjaniec/domains/lukasz.adamjaniec.com/fcgi-bin/php7.4.fcgi .php7.4
</Directory>

On 5 Oct 2021, at 16:00, ddave001 @.***> wrote:

Also, you can check if your apache config supports allow override https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride to make sure app/api/.htaccess is respected.

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted

We don't provide paid support through the open-source project. You may get paid support via icehrm.com https://icehrm.com/ if you have an active license for IceHrmPro.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gamonoid/icehrm/issues/187#issuecomment-934441915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKZZOF4SD4VZPWPF4GBZULUFMAHJANCNFSM4HNFWQCQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

chopperpl commented 2 years ago

So, I got this working on nginx standalone vm. My issues were with plesk and virtualmin (both running Apache), which I couldn't overcome. Thanks for the hints.

chopperpl commented 2 years ago

Although, I got the mobile app working I see there are only 3 languages available, which does not match whatever is available in IceHRM back end. I assume the translation is not pulled from the back-end :(. Is the source code for Mobile app available for translation? If not, then could you send me the lang file, so I can translate it for you? Thanks