# How to use a secret password in UE (only server should know it)

**URL:** <https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492>\
**Category:** C++\
**Tags:** httprequest, unreal-engine, Multiplayer, CPP, question\
**Created:** [July 24, 2023, 11:40am UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492 "2023-07-24T11:40:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [July 24, 2023, 11:40am UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492/1 "2023-07-24T11:40:54Z")

</div>

Hello all. I have a multiplayer game, and would like to make some HTTP POST requests to update player statistics. However, I only want to do these requests from the server, and would like to send a password in the body of the request to process it. But I don’t want to hardcode the password in UE; I was thinking of including the password in an encrypted CSV file, and then decrypting the file in my C++ code to get the password and use in my HTTP request. But I was thinking that if players are able to see this decryption process, then they could easily get the password themselves.

What are some solutions to this?

---

<div class="post-metadata">

**Author:** ![Seishoku](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seishoku/32/88718_2.png) [@Seishoku](https://forums.unrealengine.com/u/Seishoku)\
**Post date:** [July 24, 2023, 12:27pm UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492/2 "2023-07-24T12:27:49Z")

</div>

Hello. Assuming you only want to be making this request from a dedicated server, that only you (other admins) have access to. Then you put all the sensitive information on that server. Even a simple .txt file will do.  
Then in your UE application you read that file to get the password or anything else.

---

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [July 24, 2023, 12:34pm UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492/3 "2023-07-24T12:34:23Z")

</div>

I see, so the server build will contain the .txt file, but the shipping build will not?

---

<div class="post-metadata">

**Author:** ![Seishoku](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seishoku/32/88718_2.png) [@Seishoku](https://forums.unrealengine.com/u/Seishoku)\
**Post date:** [July 24, 2023, 12:37pm UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492/4 "2023-07-24T12:37:12Z")

</div>

Exactly. The game build doesn’t have to include the .txt file at all. It just has to look for it in some location. And on the server you will make sure it’s there. If it’s not found - the request should be skipped.

---

<div class="post-metadata">

**Author:** ![ackyshacky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ackyshacky/32/600284_2.png) [@ackyshacky](https://forums.unrealengine.com/u/ackyshacky)\
**Post date:** [July 24, 2023, 12:38pm UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492/5 "2023-07-24T12:38:59Z")

</div>

Got it. Thanks @Seishoku !

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [August 23, 2023, 12:39pm UTC](https://forums.unrealengine.com/t/how-to-use-a-secret-password-in-ue-only-server-should-know-it/1238492/6 "2023-08-23T12:39:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
