LinkedIn OAuth2 Authorization server encountered an unexpected condition
Asked Answered
D

2

8

We're getting this weird error for some of our users who are trying to authenticate via linked in OAuth2 API from mobile within a webview.

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=XXX&state=XXX&redirect_uri=XXX&scope=r_emailaddress%20r_basicprofile

After the submit ( https://www.linkedin.com/uas/oauth2/authorizedialog/submit ), there is a redirect to our redirect uri with the following params.

?error=server_error&error_description=XXX&state=the+authorization+server+encountered+an+unexpected+condition

I went through this => http://chriskief.com/2014/04/23/linkedin-api-unable-to-retrieve-access-token/ .

Creating a new application or generating fresh keys is a problem as it would break the linked in login for already installed apps. We have never use OAuth1 before.

Daily answered 19/2, 2016 at 7:53 Comment(3)
I'm getting this too -- notably for mobile users. Did you get any further insights?Cableway
I'm getting this too, especially for mobile users. We managed to reproduce the bug once: it bugged with one account only and only on mobile (Android Chrome, iPhone Safari, and iPhone Chrome) but it worked on Desktop (OSX Safari and OSX Chrome). With other accounts on the same devices everything worked fine. After 15 min of testing it worked again...Pelfrey
did u manage to fix it ?Taimi
S
2

We were able to reproduce this error when a space character is added before or after the user's email address on the LinkedIn authorization form. LinkedIn doesn't do any trimming of extraneous whitespace on this field.

My hypothesis is that this happens on mobile when people use the space bar as a way to accept an autocompletion recommendation on the email address. So the user starts typing their email address, the OS recommends a known email address and, generally, mobile OSs will use the recommendation when the space bar is pressed.

Squarely answered 3/2, 2017 at 19:48 Comment(2)
I've tried to report a bug to Linkedin, though didn't find anywhere to do so. Do u have any idea where is this possible? (also see https://mcmap.net/q/1473107/-linkedin-bug-reporting)Taimi
Yep, I encountered this too. It was the space after the email.Psychognosis
C
0

I had this exact problem. In my case, the problem was that I was overriding the default authorization scope (using ?scope=..). I'm not sure why this caused the problem, or why it always happened to mobile users. But removing the override made it go away.

Cableway answered 15/6, 2016 at 20:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.