Revision 3c5a2b21 snf-astakos-app/astakos/im/views/target/linkedin.py
b/snf-astakos-app/astakos/im/views/target/linkedin.py | ||
---|---|---|
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 | 34 |
import json |
35 |
import logging |
|
36 |
import oauth2 as oauth |
|
37 |
import cgi |
|
35 | 38 |
|
36 | 39 |
from django.contrib import messages |
37 | 40 |
from django.views.decorators.http import require_http_methods |
38 | 41 |
from django.http import HttpResponseRedirect |
39 | 42 |
from django.core.urlresolvers import reverse |
43 |
from django.conf import settings as django_settings |
|
40 | 44 |
|
41 | 45 |
from astakos.im.models import AstakosUser |
42 | 46 |
from astakos.im import settings |
43 | 47 |
from astakos.im.views.target import get_pending_key, \ |
44 |
handle_third_party_signup, handle_third_party_login, init_third_party_session |
|
48 |
handle_third_party_signup, handle_third_party_login, \ |
|
49 |
init_third_party_session |
|
45 | 50 |
from astakos.im.views.decorators import cookie_fix, \ |
46 | 51 |
requires_auth_provider |
47 | 52 |
|
48 |
import logging |
|
49 |
|
|
50 | 53 |
logger = logging.getLogger(__name__) |
51 | 54 |
|
52 |
import oauth2 as oauth |
|
53 |
import cgi |
|
54 | 55 |
|
56 |
def django_setting(key, default): |
|
57 |
return getattr(django_settings, 'GOOGLE_%s' % key.upper, default) |
|
55 | 58 |
|
56 |
request_token_url = 'https://api.linkedin.com/uas/oauth/requestToken?scope=r_basicprofile+r_emailaddress' |
|
57 |
access_token_url = 'https://api.linkedin.com/uas/oauth/accessToken' |
|
58 |
authenticate_url = 'https://www.linkedin.com/uas/oauth/authorize' |
|
59 |
token_scope = 'r_basicprofile+r_emailaddress' |
|
60 |
request_token_url = django_setting( |
|
61 |
'request_token_url', |
|
62 |
'https://api.linkedin.com/uas/oauth/requestToken?scope=' + token_scope) |
|
63 |
access_token_url = django_setting( |
|
64 |
'access_token_url', |
|
65 |
'https://api.linkedin.com/uas/oauth/accessToken') |
|
66 |
authenticate_url = django_setting( |
|
67 |
'authenticate_url', |
|
68 |
'https://www.linkedin.com/uas/oauth/authorize') |
|
59 | 69 |
|
60 | 70 |
|
61 | 71 |
@requires_auth_provider('linkedin') |
Also available in: Unified diff