Is there any possible way to root temporary
No. You can undo most of the process, including flashing back stock firmware and recovery, but you cannot revert bootloader to the factory locked state, relocked at best. They will know.
and if so will it trigger knox?
Yes, rooting WILL trip/blow the KNoX fuse. It doesn't "trigger knox" but the fuse itself.
and if so can I untrigger knox again after root is removed?
NO. Once again, knox is not what you think. It is a complex system consisting of BOTH software and hardware components. Among many components, it has a physical FUSE inside the SoC (ie. the snapdragon or exynos chip) which will be tripped/blown once knox detects such an intrusion. There is absolutely no way to undo this, and there never will be, as such a trip operation physically changes ("damages") your chip. It of course doesn't damage it really but leave a permament mark and from that point on, warranty is void and many security features that depend on knox will not work. You can even see this change with a powerful microscope. (Just google it)
I need to add some 2fa auth keys to an app which requires root since I got them backed up from my old phone.
That is absolutely not worth it in my opinion. Just do it on an emulator or on an old phone and harvest the keys. Many 2FA auth gen apps now offer migration methods, and even if it doesn't, there is always a way.
But that is not rooting and ruining this beautiful phone just because you couldn't migrate your data in a different way. You can.
Just my opinion.