Mobile Application : login blocked due to authorization request

Hello,
I cannot use the mobile application to connect to my site
I get this message when trying to log in:

Like the first time I’m connecting to meta.discourse.org.

But if I click “authorize”, then for meta.discourse.org it’s working, on my forum it’s never working, I get this message:

Does anyone already encountered this issue?
I didn’t notice this when the site was not HTTPS. Maybe there could be a link by some way…

Here is the error log title:
Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint “index_user_api_keys_on_client_id”

not sure I can share safely the details of the log.

My phone is a BQ AQUARIS X PRO
Android : 8.1.0
The same issue appears also on SAMSUNG S8 and IPHONE 5 iOS 10.3.3

What version of Discourse are you on? Be sure to update to latest.

1 Like

Appears to be running 2.0.0.beta4 per: digIT@Volvo Group so I suspect something else is at play.

What plugins do you have installed @Pierre_GRAND are there any errors in logs: Where are all the Discourse logs

3 Likes

hello, it’s true that my forum is in the last beta version.
No plugin installed.
will have a look more in detail in the logs, thanks for this sharing Sam.
For now I just verified the GUI log and found this message:

Failed to handle exception in exception app middleware : PG::UniqueViolation: ERROR: duplicate key value violates unique constraint “index_user_api_keys_on_client_id”

Hmmm, can you go to your user page and revoke all the user api keys you have and try again?

Hi Sam, sorry not sure to follow you.
I went to the User settings but didn’t find any API related function.
I went to he API tab in settings but there is no key generated.

There must be something I’m missing in the basic conf.
In all the discourse forum I’m using on my mobile only mine is behaving like this.

I manage to connect to the forum through the app in the end but I get disconnected when I leave the app.
Whereas all the other forums(meta.discourse, ubuntu) stay connected…
Could it be linked to single sign on feature?
I’m not using any SSO for mine.

I tried to generate a key for all user, didn’t change a thing for now.
will deep dive in log now, but I’m not sure what I’m looking for…

I noticed a strange behavior that might give some hint on the issue.
I have a dev instance of the forum on which in the past I validated the domain name and https deployment with let’s encrypt.
when setting up the dev in Discourse mobile app using the server hostname, I can see the redirection toward the https of my production environment.

Could there be some remaining forward on the dev server that redirect from dev to prod?(I re run the discourse setup with let’s encrypt set at “OFF”)
Could that affect the prod login?

I’ve had the same issue for a long time now for my own forum with the mobile login. I think I noticed it first happening when I switched SSO providers and the external ids were changed when I logged in again. It could have been be because I reused some of the same usernames but made new accounts with different emails but I always changed it before making another and there are none conflicting now.

The error log always says
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_user_api_keys_on_client_id" DETAIL: Key (client_id)=(

Hello,
on my side I solved the issue simply by cleaning the browser cahce of my client. The change of hostname and domain name of the server was not integrated in a proper way in the client.
Sorry for the late feedback.
Pierre

3 Likes

This topic was automatically closed after 33 hours. New replies are no longer allowed.