Knowledge Base: Can I pass the exchange code to a server to have the server request an Auth access token?

No, the exchange code is meant to be used on clients, and needs to be used as quickly as possible after the game is launched so it doesn’t expire. On servers use client_credentials grant type if you don’t need authorization from the client, or use authorization_code if you do. See Auth Web APIs…

https://dev.epicgames.com/community/learning/knowledge-base/KJOoe/epic-online-services-can-i-pass-the-exchange-code-to-a-server-to-have-the-server-request-an-auth-access-token