class ProviderConfiguration implements Persistable {

    void validate(boolean isOAuth2) throws IllegalArgumentException {
        if (TextUtils.isEmpty(authorization_endpoint)) {
            throw new IllegalArgumentException("authorization_endpoint is missing");
        }
        if (TextUtils.isEmpty(end_session_endpoint)) {
            throw new IllegalArgumentException("end_session_endpoint is missing");
        }
        if (TextUtils.isEmpty(introspection_endpoint)) {
            throw new IllegalArgumentException("introspection_endpoint is missing");
        }
        if (TextUtils.isEmpty(issuer)) {
            throw new IllegalArgumentException("issuer is missing");
        }
        if (TextUtils.isEmpty(jwks_uri)) {
            throw new IllegalArgumentException("jwks_uri is missing");
        }
        if (TextUtils.isEmpty(registration_endpoint)) {
            throw new IllegalArgumentException("registration_endpoint is missing");
        }
        if (TextUtils.isEmpty(revocation_endpoint)) {
            throw new IllegalArgumentException("revocation_endpoint is missing");
        }
        if (TextUtils.isEmpty(token_endpoint)) {
            throw new IllegalArgumentException("token_endpoint is missing");
        }
        //Oauth2 server configuration doesn't contain userinfo_endpoint.
        if (!isOAuth2 && TextUtils.isEmpty(userinfo_endpoint)) {
            throw new IllegalArgumentException("userinfo_endpoint is missing");
        }
    }

    @VisibleForTesting public  ProviderConfiguration();
    public  ProviderConfiguration(CustomConfiguration config);

}