Revision b4b82ec4 snf-django-lib/snf_django/lib/astakos.py

b/snf-django-lib/snf_django/lib/astakos.py
1
# Copyright 2011-2012 GRNET S.A. All rights reserved.
1
# Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
2 2
#
3 3
# Redistribution and use in source and binary forms, with or
4 4
# without modification, are permitted provided that the following
......
44 44
    client = AstakosClient(token, astakos_auth_url,
45 45
                           retry=2, use_pool=True, logger=logger)
46 46
    try:
47
        return client.get_user_info()
47
        return client.authenticate()
48 48
    except Unauthorized:
49 49
        return None
50 50

  
......
65 65
    if not user:
66 66
        return None
67 67

  
68
    # use user uuid, instead of email, keep email/displayname reference
69
    # to user_id
70
    request.user_uniq = user['uuid']
68
    request.user_uniq = user['access']['user']['id']
71 69
    request.user = user
72
    request.user_id = user.get('displayname')
73 70
    return user
74 71

  
75 72

  

Also available in: Unified diff