'Extract the access key identifier.
For v 0/1/2/3 this is passed as the AccessKeyId parameter,
for version4 it is either and X-Amz-Credential parameter or a
Credential= field in the \'Authorization\' header string.'

def _get_access(self, req):

    access = req.params.get('AWSAccessKeyId')
    if (access is None):
        cred_param = req.params.get('X-Amz-Credential')
        if cred_param:
            access = cred_param.split('/')[0]
    if ((access is None) and ('Authorization' in req.headers)):
        auth_str = req.headers['Authorization']
        cred_str = auth_str.partition('Credential=')[2].split(',')[0]
        access = cred_str.split('/')[0]
    return access
