@staticmethod
def create_authentication_from_json(values):
    """Create authentication object from a JSON dict."""
    key_id = values.get('publicKey')
    authentication_type = values.get('type')
    if not key_id:
        raise ValueError(
            f'Invalid authentication definition, "publicKey" is missing: {values}'
            )
    authentication = {'type': authentication_type, 'publicKey': key_id}
    return authentication
