Linkedin OAuth 2.0 settings using elasticsearch

Hi All,

I am trying to access the Linkedin content via api using elasticsearch.

I have created a linkedin app and trying to give the access and redirect url to http://localhost:9200.

after click on the allow button,

image

I am getting the error:

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"request [/] contains unrecognized parameters: [code], [state]"}],"type":"illegal_argument_exception","reason":"request [/] contains unrecognized parameters: [code], [state]"},"status":400}

can anyone tell me where I am going wrong?

my actual goal is to pass the linkedin API URL to logstash and apply some filters and then store in elasticsearch.

Any Ideas?

Thanks,
Manideep

It looks like you want to use OAuth2.0 to access Elasticsearch using Linkedin as an Authorization server? As in, you want to login to Elasticsearch with your Linkedin account ? This is unfortunately not possible.

Linkedin seems to have a custom API/protocol for a "Sign in with Linkedin" user experience that is based on oAuth2.

Elasticsearch (as of version 7.2) supports OpenID Connect, which is an authentication protocol based on oAuth2 and is considered the de facto standard for authentication based on oAuth2. As long as Linkedin doesn't support OpenID Connect, you won't be able to use it to authenticate to Elasticsearch. Your only option is to implement a custom realm for Elasticsearch and support Linkedin's protocol.

Can you clarify this a little further ? This doesn't sound like it requires you/your users to login with Linkedin, but maybe I have misunderstood your use case.

Hi @ikakavas,

Thank you for the response and it sounds fair.

I actually want to index the content from public pages in LinkedIn.

I initially thought, I need to use OAuth 2.0 but then realized that it is not possible to sign in every time to get the new access token for every member.

Is there a legal way, that I can index the content or basic members data from public pages in elasticsearch.?

Thanks,
Manideep

Hi Manideep,

This question would be exactly the same if you substitute Elasticsearch with anything else, and in that sense I don't think this forum is the best place to get some useful/definitive answer. Maybe you can look at the Linkedin terms of service or ask in a more generic forum

Hi @ikakavas

Thank you for your response. I realized this late.

Cheers,
Manideep