@Override
    public void setAuthenticated(final boolean authenticated) {
        if (authenticated) {
            throw new IllegalArgumentException(
                    "Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead");
        }
        super.setAuthenticated(false);
    }
Creates a new X509CertificateAuthentication that was authenticated using the given certificate. This constructor
should only be used by {@link AuthenticationManager}s or {@link AuthenticationProvider}s. The resulting
authentication is trusted ({@link #isAuthenticated()} returns true) and has the given authorities.

@param principal The authenticated principal.
@param certificate The certificate that was used to authenticate the principal.
@param authorities The authorities of the principal.
grpc-server-spring-boot-starter/src/main/java/net/devh/boot/grpc/server/security/authentication/X509CertificateAuthentication.java