You may need to specify basic auth method in dnf.conf like this
[main] gpgcheck=1 installonly_limit=3 clean_requirements_on_remove=True proxy=http://proxy/example.com:8080 proxy_username=username proxy_password=password proxy_auth_method=basic