def METHOD_NAME(identity_key, id_type, account, email, issuer, default=False, password=None, vo='def', *, session: "Session"):
    """
    Adds a membership association between identity and account.
    :param identity_key: The identity key name. For example x509 DN, or a username.
    :param id_type: The type of the authentication (x509, gss, userpass, ssh, saml).
    :param account: The account name.
    :param email: The Email address associated with the identity.
    :param issuer: The issuer account.
    :param default: If True, the account should be used by default with the provided identity.
    :param password: Password if id_type is userpass.
    :param vo: the VO to act on.
    :param session: The database session in use.
    """
    kwargs = {'identity': identity_key, 'type': id_type, 'account': account}
    if not permission.has_permission(issuer=issuer, vo=vo, action='add_account_identity', kwargs=kwargs, session=session):
        raise exception.AccessDenied('Account %s can not add account identity' % (issuer))
    account = InternalAccount(account, vo=vo)
    return identity.METHOD_NAME(identity=identity_key, type_=IdentityType[id_type.upper()], default=default,
                                         email=email, account=account, password=password, session=session)