개인 프로필 및 회사 프로필에서 일부 데이터를 스크래핑하기 위해 linkedin API에서 인증하려고합니다. 나는 developer.linkedin.com에서 제공하는 OAuth2.0 문서와 끔찍하게 혼돈 스럽다. 액세스 데이터 포인트에 올바른 api 호출을 사용하고 있는지 확실하지 않습니다. 예를 들어, 나는 많은 사용자들의 프로파일을 작업 내역 등으로 원합니다.하지만 내가 공격하기 전에 API 호출을하기 위해 사용자를 인증하려면 어떻게해야합니까? 나는 꽃 봉오리가 사용자 인증 linkedin -
client_id ='.....'
client_secret='.....'
authorization_base_url = 'https://www.linkedin.com/uas/oauth2/authorization'
token_url = 'https://www.linkedin.com/uas/oauth2/accessToken'
linkedin = OAuth2Session(client_id, redirect_uri='https://127.0.0.1')
linkedin = linkedin_compliance_fix(linkedin)
authorization_url, state = linkedin.authorization_url(authorization_base_url)
print 'Please go here and authorize,', authorization_url
redirect_response = raw_input('Paste the full redirect URL here:')
#here I add https://127.0.0.1
linkedin.fetch_token(token_url, client_secret=client_secret,
authorization_response=redirect_response)
r = linkedin.get('https://api.linkedin.com/v1/people/~')
print r.content
내가 여기에서 튜토리얼을 따라 워크하지 않습니다 다음 사용 : 여기
https://github.com/requests/requests-oauthlib/blob/master/docs/examples/linkedin.rst
내가 입력 한 메시지입니다 - https://127.0.0.1을 터미널이를 요청한다.
python ~/linkedin.py
Please go here and authorize, https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=777m76reoggue0&redirect_uri=https%3A%2F%2F127.0.0.1&state=bo91J8MNuMTx1WQWn9nLd5kgGbZYFE
**Paste the full redirect URL here:https://127.0.0.1**
Traceback (most recent call last):
File "~/linkedin.py", line 22, in <module>
authorization_response=redirect_response)
File "/anaconda/lib/python2.7/site-packages/requests_oauthlib/oauth2_session.py", line 187, in fetch_token
state=self._state)
File "/anaconda/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 174, in parse_request_uri_response
response = parse_authorization_code_response(uri, state=state)
File "/anaconda/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 227, in parse_authorization_code_response
raise MissingCodeError("Missing code parameter in response.")
oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.
당신이 모든 관련 라이브러리 또는 오류 메시지를 포함하십시오 수 있음을 붙여? – andrewgu
안녕하세요 andrewgu, 미안, 미숙하게 게시했습니다. – lpt
LinkedIn에서 연결된 앱을 만드는 동안 'redirect_uri'를 등록하셨습니까? –