spring social linkedin. How do I know if linkedin user is/has a company?

151 Views Asked by At

Is there a way to know if the logged in user (through linkedin) is/has a company associated ?

I need to allow access to my app only linkedin companies. How can I validate if the logged in user is a linkedin company or a regular user ?

1

There are 1 best solutions below

6
On

The LinkedInProfile class only contains the basic profile information which does not help in distinguishing if the logged in user is a regular user or company. This class extends LinkedInObject which contains extraData property for carrying any data in response from LinkedIn that won't be otherwise mapped to any properties of the subclass.

The getExtraData method returns a Map<String, Object> which contains the extra information. In this Map check if company-type key is available, if YES then you can conclude that the logged in user is of type Company.

The possible values of company-type are:

  • C ("Public Company")
  • D ("Educational")
  • E ("Self Employed")
  • G ("Government Agency")
  • N ("Non Profit")
  • O ("Self Owned")
  • P ("Privately Held")
  • S ("Partnership")