You represent the Catholic Church doctrine as authoritative; I submit to you, however, that the Bible is the ultimate authority.
All Scripture is given by inspiration of God, and is profitable for doctrine, for reproof, for correction, for instruction in righteousness, that the man of God may be complete, thoroughly equipped for every good work. [2 Timothy 3:16-17]
Where mans law is in conflict with Gods law, Gods law should be obeyed. The Church is composed on Godly men, but men nevertheless. Where the Churchs doctrine is in conflict with Scripture, Gods word should be obeyed. As long as there is no conflict with Scripture, Church doctrine may be followed. Where there is no applicable Scripture or Church doctrine, then a Christian should follow their conscience.
Specifically, the Bible states that homosexuality is a sin; it does not say that issuing a marriage license to homosexuals is a sin. If the law required me to be a homosexual, I would refuse (clear conflict with Gods law). If I were a license clerk and the law required me to issue a marriage license to homosexuals, I would have to resign in protest (matter of conscience).
The Holocaust example puts a very fine point on this issue. Being commanded by superior officers to commit premeditated murder is a direct conflict with Gods law. Truly, your question WWJD is an interesting one. We know that Jesus died on the cross as a sin offering for all of us, so that whoever believes in Him will not die but have life everlasting. I suspect Jesus would have resisted unto death.
On the other hand, what would Jesus have US do? I am not qualified to attempt to answer. I know He would not have us submit; whether to resign, refuse, or obstruct, however, is the hard part. Again, a matter of conscience.
I would like to think I would obstruct at risk of my own death, since there is no greater love than to lay down ones life for his friends. In truth, I cannot know what I would have done.