Revision 49005665 snf-astakos-app/astakos/api/tokens.py

b/snf-astakos-app/astakos/api/tokens.py
92 92

  
93 93
    uuid = None
94 94
    try:
95
        tenant = req['auth']['tenantName']
95 96
        token_id = req['auth']['token']['id']
96 97
    except KeyError:
97 98
        try:
......
108 109
    except AstakosUser.DoesNotExist:
109 110
        raise faults.Unauthorized('Invalid token')
110 111

  
112
    if tenant != user.uuid:
113
        raise faults.Unauthorized('Invalid tenant')
114

  
111 115
    if uuid is not None:
112 116
        if user.uuid != uuid:
113 117
            raise faults.Unauthorized('Invalid credentials')
......
125 129
        append({'name': s.name, 'type': s.type,
126 130
                'endpoints': [{'adminURL': s.api_url,
127 131
                               'publicURL': s.api_url,
128
                               'internalUrl': s.api_url,
132
                               'internalURL': s.api_url,
129 133
                               'SNF:uiURL': s.url,
130 134
                               'region': s.name}]})
131 135

  
132 136
    if request.serialization == 'xml':
133
        return xml_response(access, 'api/access.xml')
137
        return xml_response({'access': access}, 'api/access.xml')
134 138
    else:
135 139
        return json_response(access)

Also available in: Unified diff