As far as I know, the Epic Account ID can be retrieved from the token, with the SDK functions to verify it (and then can be trusted, because the JWT token “sub” is always trusted.)
EOS and EAS are really poorly implemented into UE.
In PreLogin I don’t know (yet) how to add custom options to connecting, say from a Main Menu I want the client to join the dedicated server and send the auth token which would be verified by the SDK. This process should also set a variable to the player, like an Epic account id if the Unique Net Id does not contain the same.
The only question left is how can I make a client connect with options to a specific dedicated server (From blueprints or C++ code does not really matter since the authentication is already cpp).
Found this on the old wiki, Passing Arguments To Server During Connection - Old UE4 Wiki.
Seems to solve the problem, passing the option and getting it on server, verifying the token and setting a replicated variable of EpicAccountId/Name/etc. Being paranoid isn’t the reason, I’ve learnt the lesson back years ago, never trust data coming from a client: DO NOT set the EpicAccID directly because the client said so.