# Storage Engine Object Privacy

**URL:** <https://forum.heroiclabs.com/t/storage-engine-object-privacy/457>\
**Category:** Local Setup\
**Tags:** getting-started\
**Created:** [January 11, 2020, 1:45am UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457 "2020-01-11T01:45:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnewcomb84](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jnewcomb84/32/150_2.png) [@jnewcomb84](https://forum.heroiclabs.com/u/jnewcomb84)\
**Post date:** [January 11, 2020, 1:45am UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/1 "2020-01-11T01:45:31Z")

</div>

Hello Nakama Guru’s,  
We are just getting started porting our Unity application to a Nakama backend instance. Right now, I’m working to create an administrative interface in React/JS. We’ve populated our user JSON objects for our current implementation, into Nakama Storage Objects. To keep things safe and secure, all storage objects are set to a private read/private write state. Is there a way to retrieve all storage objects for a specific user, without setting all storage objects to public read? I noted that the listStorageObjects method will not return private storage objects. Is there an administrative override?

Much Appreciated,  
Jeremy

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [January 11, 2020, 1:02pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/2 "2020-01-11T13:02:07Z")

</div>

Hey @jnewcomb84 welcome 👋

> Is there a way to retrieve all storage objects for a specific user, without setting all storage objects to public read? I noted that the listStorageObjects method will not return private storage objects. Is there an administrative override?

For these kinds of administrative use cases you should look at the devconsole API and use custom RPC functions where needed. The devconsole API is what’s used by the internal dashboard provided within Nakama. Have a look at the Swagger spec for more information on what’s available:

> <https://github.com/heroiclabs/nakama/blob/master/console/console.swagger.json>

We use our own code generator to turn the Swagger spec into a TypeScript client used by the dashboard itself. This could speed up the time it’d take for you interact with that API:

[https://github.com/heroiclabs/nakama/blob/master/console/ui/src/api.gen.ts](https://github.com/heroiclabs/nakama/blob/master/console/ui/src/api.gen.ts)

Hope that helps.

---

<div class="post-metadata">

**Author:** ![jnewcomb84](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jnewcomb84/32/150_2.png) [@jnewcomb84](https://forum.heroiclabs.com/u/jnewcomb84)\
**Post date:** [January 13, 2020, 7:27pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/3 "2020-01-13T19:27:10Z")

</div>

Thank you @novabyte, that certainly does help. I was able to hit my endpoint with the matching route in order to get a user’s storage objects. However, it seems like this can be done without having to authenticate with the server, first. Is this true? And if so, is there any way to implement authentication for these routes?

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [January 13, 2020, 8:03pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/4 "2020-01-13T20:03:29Z")

</div>

The console API does use authentication. You can see the logic for it online in [this code](https://github.com/heroiclabs/nakama/blob/master/server/console.go#L170). Which endpoint do you connect?

---

<div class="post-metadata">

**Author:** ![jnewcomb84](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jnewcomb84/32/150_2.png) [@jnewcomb84](https://forum.heroiclabs.com/u/jnewcomb84)\
**Post date:** [January 13, 2020, 9:16pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/5 "2020-01-13T21:16:12Z")

</div>

Yes, I saw that which is why I’m confused. I used Postman to connect to the endpoint without a token or username/password. Is it only implemented for post/put/delete endpoints? I was using a get command to v2/console/storage?user\_id={UID}. I appreciate all your help 🙂

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [January 14, 2020, 9:25pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/6 "2020-01-14T21:25:23Z")

</div>

@jnewcomb84 You’re right. It’s linked to a code change that was made to simplify how our internal gateway wraps around the GRPC endpoints. We’ve created a [patch release](https://github.com/heroiclabs/nakama/releases/v2.9.1) of Nakama. Please upgrade and let me know.

---

<div class="post-metadata">

**Author:** ![jnewcomb84](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/jnewcomb84/32/150_2.png) [@jnewcomb84](https://forum.heroiclabs.com/u/jnewcomb84)\
**Post date:** [January 15, 2020, 1:32am UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/8 "2020-01-15T01:32:04Z")

</div>

Looks like it worked for the RPCs. But now we cannot connect with our Unity client because there is no authentication parameter to pass to the Client. Any thoughts on why the update broke our unity connection?

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [January 15, 2020, 10:18am UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/9 "2020-01-15T10:18:04Z")

</div>

@jnewcomb84 I think there’s some confusion about the APIs available in Nakama. We have two different APIs which are useful for different purposes in the game server:

1. Server API. This is the main API which exposes all the features of the game server. All our official client SDKs use this API.
2. Developer Console API. This was the API I mentioned earlier in the thread. It’s an internal administrative API that can be used to programmatically access resources about players and data stored. It’s used by our Developer Console dashboard that’s bundled within the game server.

The second API is not accessible from the client SDKs. We don’t support it from any of the client SDKs instead we recommend you use the REST endpoints directly or utilize the GRPC client for it generated as a Go package.

I could code generate a small low-level client object for you to use from .NET code if it helps?

---

<div class="post-metadata">

**Author:** ![andrew.jones](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@andrew.jones](https://forum.heroiclabs.com/u/andrew.jones)\
**Post date:** [January 15, 2020, 5:11pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/10 "2020-01-15T17:11:18Z")

</div>

> [@novabyte](#):
>
> er API. This is the main API which exposes all the features of the game server. All our official

Just to add some clarification to this. The Unity api for creating a new Client and authenticating with AuthenticateCustomAsync method that we were using prior to the update was working i.e.  
new Client(“http”, “[nakama-dev.com](http://nakama-dev.com)”, 7350, “SomeServerKey”);  
After the update, we no longer can authenticate with the Nakama server. There is no error message in the logs.

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [January 15, 2020, 11:04pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/11 "2020-01-15T23:04:19Z")

</div>

Hi @andrew.jones. I’ve run a local deployment of Nakama with `docker-compose -f ./docker-compose.yml up` which shows this log line with the server in DEBUG level:

```auto
{"level":"info","ts":"2020-01-15T22:06:06.668Z","msg":"Node","name":"nakama1","version":"2.9.1+31694947","runtime":"go1.13.6","cpu":4,"proc":4}

```

I ran a small amount of Unity code to authenticate with a custom identifier:

```auto
var client = new Client("defaultkey");
var customId = SystemInfo.deviceUniqueIdentifier;
var session = await client.AuthenticateCustomAsync(customId);
Debug.LogFormat("Session user id: '{0}'", session.UserId);

```

It prints out this info in the Unity editor console:

```auto
Session user id: 'c55c15cc-11d1-45bd-9134-b22c7fb0d8e2'
UnityEngine.Debug:LogFormat(String, Object[])

```

I have no problem with the server and the main API at all. I don’t think there’s any crossover between what @jnewcomb84 reported and connectivity to the main API. Do you run Nakama behind a load balancer?

---

<div class="post-metadata">

**Author:** ![andrew.jones](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@andrew.jones](https://forum.heroiclabs.com/u/andrew.jones)\
**Post date:** [January 16, 2020, 5:46pm UTC](https://forum.heroiclabs.com/t/storage-engine-object-privacy/457/12 "2020-01-16T17:46:55Z")

</div>

It seems like it was some weirdness on our end. Restarted Unity and it is connecting just fine.
