def _get_user_id_from_access_token(access_token):
    """
    Get user's identifier from the access token claims
    """
    token_user_id = access_token.get("sub")
    if token_user_id:
        try:
            token_user_id = int(token_user_id)
        except ValueError:
            # if we can't cast to an int, that's an issue. fence should
            # only issue access tokens with the user's id as the sub field.
            token_user_id = None

    return token_user_id