# Mobile Application : login blocked due to authorization request

**URL:** https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301
**Category:** Support
**Created:** [March 19, 2018, 2:04pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301 "2018-03-19T14:04:49Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Pierre\_GRAND](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pierre\_GRAND](https://meta.discourse.org/u/Pierre_GRAND)
#### Post date: [March 19, 2018, 2:04pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/1 "2018-03-19T14:04:49Z")

</div>

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

 ![Screenshot_20180319-144252](https://global.discourse-cdn.com/meta/original/3X/9/e/9ee9d5ad61712cb3e219fa2c85f8515e3537518e.png)

Like the first time I’m connecting to [meta.discourse.org](http://meta.discourse.org).

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

 ![Screenshot_20180319-145145](https://global.discourse-cdn.com/meta/original/3X/d/7/d7280bc48a57c3c05371aad0ca2641306ab35493.png)

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 20, 2018, 12:03am UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/2 "2018-03-20T00:03:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 20, 2018, 12:05am UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/3 "2018-03-20T00:05:37Z")

</div>

Appears to be running 2.0.0.beta4 per: [https://groupitioscommunity.com/login](https://groupitioscommunity.com/login) so I suspect something else is at play.

What plugins do you have installed @Pierre_GRAND are there any errors in logs: [Where does Discourse store and show logs?](https://meta.discourse.org/t/where-are-all-the-discourse-logs/58022)

---

<div class="post-metadata">

### Author: ![Pierre\_GRAND](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pierre\_GRAND](https://meta.discourse.org/u/Pierre_GRAND)
#### Post date: [March 20, 2018, 11:34am UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/4 "2018-03-20T11:34:44Z")

</div>

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”

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 20, 2018, 11:50pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/5 "2018-03-20T23:50:26Z")

</div>

> [@Pierre\_GRAND](#):
>
> “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?

---

<div class="post-metadata">

### Author: ![Pierre\_GRAND](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pierre\_GRAND](https://meta.discourse.org/u/Pierre_GRAND)
#### Post date: [March 21, 2018, 6:58am UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/6 "2018-03-21T06:58:51Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Pierre\_GRAND](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pierre\_GRAND](https://meta.discourse.org/u/Pierre_GRAND)
#### Post date: [March 21, 2018, 12:29pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/7 "2018-03-21T12:29:42Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![Pierre\_GRAND](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pierre\_GRAND](https://meta.discourse.org/u/Pierre_GRAND)
#### Post date: [March 22, 2018, 12:46pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/8 "2018-03-22T12:46:12Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![judah4](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/judah4/32/119792_2.png) [@judah4](https://meta.discourse.org/u/judah4)
#### Post date: [July 3, 2018, 11:17pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/9 "2018-07-03T23:17:38Z")

</div>

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)=(`

---

<div class="post-metadata">

### Author: ![Pierre\_GRAND](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pierre\_GRAND](https://meta.discourse.org/u/Pierre_GRAND)
#### Post date: [July 26, 2018, 7:02am UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/10 "2018-07-26T07:02:43Z")

</div>

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

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [July 27, 2018, 5:00pm UTC](https://meta.discourse.org/t/mobile-application-login-blocked-due-to-authorization-request/83301/11 "2018-07-27T17:00:05Z")

</div>

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