English 中文(简体)
t在与ALinkedin在安乐器上成功登录后能否获得联系人身份?
原标题:Can t get the Linkedin ID after login successfully with Linkedin on Android app?

我利用链接联系我的申请。 我需要用户Id、脚本和肯特。 我拿到了两条灯塔,但我可以拿到目前用户的id子!

电话:p.getId(); 寄给我一 null。

我的守则如下:

String verifier = intent.getData().getQueryParameter("oauth_verifier");

    LinkedInAccessToken accessToken = oAuthService.getOAuthAccessToken(liToken, verifier);
    client = factory.createLinkedInApiClient(accessToken);
    client.postNetworkUpdate("LinkedIn Android app test");
    Person p = client.getProfileForCurrentUser();

    System.out.println("TEST "+client.getProfileForCurrentUser());

    System.out.println("Token  "+accessToken.getToken());

    System.out.println("Secret  "+accessToken.getTokenSecret());

    System.out.println("NOM "+p.getLastName() + ", PRENOM" + p.getFirstName());

    Person profile = client.getProfileForCurrentUser(EnumSet.of(ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.CERTIFICATIONS_ID));
    //System.out.println("IDDDDD"+profile.getId());

    Connections connections = client.getConnectionsForCurrentUser();
    System.out.println("Total connections fetched:" + connections.getTotal());
    for (Person person : connections.getPersonList()) {
            System.out.println(person.getId() + ":" + person.getFirstName() + " " + person.getLastName() + ":" + person.getHeadline());
    }

帮助! 感谢!

问题回答

请替换这一行文。

Person profile = client.getProfileForCurrentUser(EnumSet.of(ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.CERTIFICATIONS_ID));

——

Person profile = client.getProfileForCurrentUser(EnumSet.of(ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.ID));

若要获得Id,Profile Field.ID就应当使用而不是。 简介领域。 CERTIFICATIONS_ID

<>加强:<>

Person profile = client.getProfileForCurrentUser(EnumSet.of(ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.CERTIFICATIONS_ID));
    //System.out.println("IDDDDD"+profile.getId());

<>>有:

final Person user_Profile = client.getProfileForCurrentUser(EnumSet.of(ProfileField.ID)); person = client.getProfileById(user_Profile.getId(), EnumSet.of(ProfileField.FIRST_NAME,
                            ProfileField.LAST_NAME));
System.out.println("IDDDDD"+profile.getId());




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签