Linkedin Oauth Javascript authorization "uh oh!"
Asked Answered
B

5

12

I can't login on my app with Linkedin, i see modal linked dialog with "uh oh!" What to do? Why don't work linkedin Oauth?

function onLinkedInLoad() {
  IN.Event.on(IN, "auth", function() {onLinkedInLogin();});
  IN.Event.on(IN, "logout", function() {onLinkedInLogout();});
}
function onLinkedInLogin() {
  IN.API.Profile("me")
    .fields(["id", "firstName", "lastName", "pictureUrl", "publicProfileUrl", "emailAddress"])
    .result(function(result) {

      console.log(firstName);
    })
    .error(function(err) {
      alert(err);
    });
}
function liAuth(){
  // 
   IN.User.authorize(function(){
       callback();
   });
   //IN.UI.Authorize().place();
}
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
    api_key: 54545645645646
    authorize: false
    onLoad: onLinkedInLoad
</script>

<div onclick="liAuth()" class="loginsocbutton loginsocbutton__in" id="oauth_linkedin">click</div>
Burghley answered 13/5, 2015 at 12:16 Comment(1)
Please check my answer it's working properly #18464213Variance
H
16

You need to go to your applications permissions immediately and uncheck all boxes except the 4 that appear in this screenshot. I was able to get my integration working again after that.

enter image description here

They seem to not be handling revoked permissions very gracefully. You, like us, were probably not using those extra permissions anyways.

Hizar answered 13/5, 2015 at 15:44 Comment(5)
Thanks! For us we only had r_basicprofile checked which gave us the great error message of uh oh! for all of our users. Enabling the r_emailaddress permission fixed the issue.Hypertonic
Thanks, you saved my day. This is the least helpful error message that I have seen.Chavarria
Yeah I don't know what they're thinking over there at LinkedIn. They've quickly become my least favorite social network out there. They must be under new leadership.Hizar
I get the same error no matter what options I choose I get the message in a popup window "uh oh!"Vanish
@Hizar I am getting the same error after following your instructions.Concoction
C
2

A change in LinkedIns API was rolled out today wrecking code everywhere.

you can read about it here:

https://developer.linkedin.com/blog https://developer.linkedin.com/partner-programs

Cottage answered 13/5, 2015 at 14:16 Comment(1)
Thank you. But i not understand, what i should do.Burghley
P
0

Besides to Jacob's answer, you need to go to your app settings and make sure that all fields are filled in - particularly logos, contact details...basically all those details that were optional before now became required. This and re-setting the permissions should work

Ponderable answered 14/5, 2015 at 6:17 Comment(0)
M
0

I had the same problem too. Message "Uh Oh!" inside the popup window, when executing IN.User.authorize(). To solve this, I recreated from scratch a new LinkedIn application, but for the same website/URL. Then I inserted the new api_key. And then it was working.

Miracle answered 27/5, 2015 at 4:20 Comment(0)
P
0

function onLinkedInLoad() {
  IN.Event.on(IN, "auth", function() {onLinkedInLogin();});
  IN.Event.on(IN, "logout", function() {onLinkedInLogout();});
}
function onLinkedInLogin() {
  IN.API.Profile("me")
    .fields(["id", "firstName", "lastName", "pictureUrl", "publicProfileUrl", "emailAddress"])
    .result(function(result) {

      console.log(firstName);
    })
    .error(function(err) {
      alert(err);
    });
}
function liAuth(){
  // 
   IN.User.authorize(function(){
       callback();
   });
   //IN.UI.Authorize().place();
}
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
    api_key: 54545645645646
    authorize: false
    onLoad: onLinkedInLoad
</script>

<div onclick="liAuth()" class="loginsocbutton loginsocbutton__in" id="oauth_linkedin">click</div>
Prescind answered 24/8, 2015 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.