You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-05-12 07:48:55

jiritomanek85
Member
Registered: 2023-05-11
Posts: 7

[SOLVED] Remove the app token

Hello, I need advice on how to remove the app token. Every time I delete it it gets restored. GLPI version 10.0.7. Thank you for your advice.

Last edited by jiritomanek85 (2023-05-17 10:38:55)

Offline

#2 2023-05-15 12:41:52

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,798
Website

Re: [SOLVED] Remove the app token

Where are you deleting this token?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2023-05-15 12:59:25

jiritomanek85
Member
Registered: 2023-05-11
Posts: 7

Re: [SOLVED] Remove the app token

Hi tried delete token via WEB interface in General settings. Everytime i tried to delete and safe. Token regenerate to new one.

Offline

#4 2023-05-15 13:45:26

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,798
Website

Re: [SOLVED] Remove the app token

The only place those tokens exist are within the API Client configuration. You cannot delete the tokens permanently, only regenerate them. What are you trying to accomplish by deleting them?


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#5 2023-05-15 14:12:02

jiritomanek85
Member
Registered: 2023-05-11
Posts: 7

Re: [SOLVED] Remove the app token

Because I want to start a GAPP app on android. When I login to the GAPP on android via username/password it reports an error:
ERROR_APP_TOKEN_PARAMETERS_MISSING connecting to GLPI API

According to their instructions it says to clear app_token.
https:// tic.gal/en/error_app_token_parameters_missing-connecting-to-glpi-api/
So I try it and it doesn't work.


Here they write that GAPP does not support app_token, so it must be deleted.
https:// tic.gal/en/how-to-setup-glpi-api/

So I don't know where to look for a bug or settings to get it to work.

Last edited by jiritomanek85 (2023-05-15 14:23:33)

Offline

#6 2023-05-15 20:26:20

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,798
Website

Re: [SOLVED] Remove the app token

That doesn't make any sense to me (for the apps to not support it), and I didn't realize that it should even be possible to connect without an app token (after looking in the code, apparently it is).
It looks like a bug was introduced when the UI was moved to Twig.
https://github.com/glpi-project/glpi/pull/13886

I've opened a pull request with a fix:
https://github.com/glpi-project/glpi/pull/14713


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#7 2023-05-16 07:13:42

jiritomanek85
Member
Registered: 2023-05-11
Posts: 7

Re: [SOLVED] Remove the app token

Here I have the answer from the ticgal/gapp github. When I described the problem to him again.

Hi,

I did some testing, and now I see what your problem is.
Apparently, once the app_token is enabled, it cannot be wiped out. I wonder if this is a bug or a feature smile.

However, you can delete the API client and create a new one to avoid the issue.
Regards,


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.

-------------------------------
Thank you for your help.

I guess I'll have to wait until the problem is solved.

Offline

#8 2023-05-16 08:27:23

hule
Member
Registered: 2023-05-16
Posts: 1

Re: [SOLVED] Remove the app token

Sadly app_token is created automaticly with new API client. You can't even remove the localhostl imit of the default API client as clicking on Save will generate API token automaticly.

Offline

#9 2023-05-16 23:13:10

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,798
Website

Re: [SOLVED] Remove the app token

As I said in my last reply, this is indeed a bug introduced in a recent 10.0.X version. I linked to a patch that will be included in the next release that fixes this behavior.
Essentially, the issue was that the value of the checkbox for regenerating the token was always being evaluated as if it were checked.
After the patch, the token is only regenerated when the checkbox is selected.

Yes, by default when creating a new API Client the checkbox will be selected to ensure the token is generated as that is considered the "best practice". However, after the patch you are free to uncheck the box or go back in after the client is created and delete/change the token field freely.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#10 2023-05-17 07:20:03

jiritomanek85
Member
Registered: 2023-05-11
Posts: 7

Re: [SOLVED] Remove the app token

OK Thank you for your help.

Offline

#11 2023-05-17 10:38:16

jiritomanek85
Member
Registered: 2023-05-11
Posts: 7

Re: [SOLVED] Remove the app token

HI I have applied the patch and it is working now thank you for the information.

https: //github.com/glpi-project/glpi/pull/14713

Hi,
Apparently the problem is from GLPI. You should patch or wait until GLPI 10.0.8.
glpi-project/glpi#14713
Regards,

Offline

#12 2023-06-26 22:22:42

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,798
Website

Re: [SOLVED] Remove the app token

There are only two changed lines in the patch, so the easiest method is to just make the changes manually.
Go to the "Files changed" tab in the pull request and you can see which files and lines are changed.

In the future, for more advanced changes, you can add ".patch" to the end of the pull request URL like this:
https://patch-diff.githubusercontent.co … 4713.patch
That will give you the raw patch file which you can save and apply using a utility like "patch" on Linux.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

Board footer

Powered by FluxBB