Commit 648fcf39 authored by Rafael Monnerat's avatar Rafael Monnerat

ERP5Security: getExternalLogin should return login instead user_id

  The implementation of external_login expects the reference of an Login object and the portal type of itself
parent be6c405a
...@@ -78,15 +78,17 @@ class ERP5AccessTokenExtractionPlugin(BasePlugin): ...@@ -78,15 +78,17 @@ class ERP5AccessTokenExtractionPlugin(BasePlugin):
external_login = None external_login = None
method = token_document._getTypeBasedMethod('getExternalLogin') method = token_document._getTypeBasedMethod('getExternalLogin')
if method is not None: if method is not None:
external_login = method() external_login, login_portal_type = method()
if external_login is not None: if external_login is not None:
creds['external_login'] = external_login creds['external_login'] = external_login
creds['login_portal_type'] = login_portal_type
creds['remote_host'] = request.get('REMOTE_HOST', '') creds['remote_host'] = request.get('REMOTE_HOST', '')
try: try:
creds['remote_address'] = request.getClientAddr() creds['remote_address'] = request.getClientAddr()
except AttributeError: except AttributeError:
creds['remote_address'] = request.get('REMOTE_ADDR', '') creds['remote_address'] = request.get('REMOTE_ADDR', '')
return creds return creds
#Form for new plugin in ZMI #Form for new plugin in ZMI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment