# Issue with the public-private key pair storage strategy

**URL:** <https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170>\
**Category:** Community Tutorials & Video\
**Created:** [August 29, 2020, 5:16pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170 "2020-08-29T17:16:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![atom](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@atom](https://forum.dfinity.org/u/atom)\
**Post date:** [August 29, 2020, 5:16pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/1 "2020-08-29T17:16:19Z")

</div>

Hello community!

Today I worked on the [“Save identity information for the incognito profile”](https://sdk.dfinity.org/docs/developers-guide/tutorials/intercanister-calls.html#_save_identity_information_for_the_incognito_profile) part of the “Making simple inter-canister calls” Developer Center tutorial.

A step consists to play with the `dfinity-ic-user-identity` key stored in the local storage of the browser.

Unfortunately, as mentioned in the [highlights of what’s new in 0.6.1](https://sdk.dfinity.org/docs/release-notes/sdk-release-notes.html#_highlights_of_whats_new_in_0_6_1):

> An update to the user authentication method enables `dfx` to use the browser’s `localStorage` for the user’s public and private keys if cookies are not enabled.

So, I tried to disable cookies in my browser in order to let `dfx` behaves the same as in the tutorial.

Here we are, I tried this approach in Firefox, Google Chrome, and Microsoft Edge with these outcomes:

- Firefox:  
– cookies enabled: `dfinity-ic-user-identity` stored in **“Cookies”**  
– cookies disabled:

> An error happened:
> 
> e.exports\<[4]

- Google Chrome and Microsoft Edge:  
– cookies enabled: `dfinity-ic-user-identity` stored in **“IndexedDB”** \> “**localforage - [http://localhost:8000](http://localhost:8000)**” \> “ **keyvaluepairs** ”  
– cookies disabled:

> An error happened:  
> Error: No available storage method found.  
> at r ([http://localhost:8000/bootstrap.js:2:225481](http://localhost:8000/bootstrap.js:2:225481))  
> at async h.getKeyPair ([http://localhost:8000/bootstrap.js:2:195986](http://localhost:8000/bootstrap.js:2:195986))  
> at async Object.t.createAgent ([http://localhost:8000/bootstrap.js:2:227669](http://localhost:8000/bootstrap.js:2:227669))  
> at async \_main ([http://localhost:8000/bootstrap.js:2:236758](http://localhost:8000/bootstrap.js:2:236758))

Did someone faced the same issue while doing the tutorial?

---

<div class="post-metadata">

**Author:** ![atom](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@atom](https://forum.dfinity.org/u/atom)\
**Post date:** [August 29, 2020, 5:34pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/2 "2020-08-29T17:34:19Z")

</div>

Just in case, I think you need to know that the project in question is a clone of LinkedUp.

As explained [here](https://forum.dfinity.org/t/running-linkedup-tutorial/439/7), I retrieved the clone directly from the [GitHub webpage](https://github.com/dfinity-lab/linkedup).

Moreover, I fixed each vulnerability listed in the output of the `npm audit` command.

Finally, I changed the `dfx` version in the `dfx.json` file from “0.6.2” to “0.6.4”.

Thank you for your time and commitment as always. 🙂

---

<div class="post-metadata">

**Author:** ![andrew\_DFN](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@andrew\_DFN](https://forum.dfinity.org/u/andrew_DFN)\
**Post date:** [September 2, 2020, 12:43am UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/3 "2020-09-02T00:43:20Z")

</div>

Hey Atom, thanks for checking out the tutorial!

I was able to reproduce the example in Chrome. It looks like Chrome is throwing the following errors:

- `DOMException: The user denied permission to access the database.`
- `DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document`

That leads me to think that none of the methods that we would use to store the key pairs are accessible if the browser’s cookies are disabled. I found [this StackOverflow post](https://stackoverflow.com/a/31164410) describing what is probably happening:

> For now, the behaviour is browser-dependent. Disabling cookies on each of these browsers disable the following:
> 
> - **Chrome** : cookies, localStorage, sessionStorage, IndexedDB
> - **Firefox** : cookies, localStorage, sessionStorage
> - **IE** : cookies only

Given that, I suspect that our front-end will not work without cookies enabled.

---

<div class="post-metadata">

**Author:** ![atom](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@atom](https://forum.dfinity.org/u/atom)\
**Post date:** [September 3, 2020, 3:57pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/4 "2020-09-03T15:57:32Z")

</div>

Hi Andrew, thank you for replying to my post! 🙂

It’s good to know about how browsers manage their cookies disabling policy.

So, as I understand the situation, that means that I cannot play with the public-private key pair as they do in the tutorial. Am I right?

If that so, I guess it would be better to remove this part from the tutorial eventually.

---

<div class="post-metadata">

**Author:** ![Dylan](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dylan/32/18010_2.png) [@Dylan](https://forum.dfinity.org/u/Dylan)\
**Post date:** [March 14, 2021, 8:28pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/5 "2021-03-14T20:28:18Z")

</div>

This problem with the tutorial still exists 7 months later. It might be a good idea to just remove this section:

> **[The Internet Computer | Documentation](https://sdk.dfinity.org/docs/developers-guide/tutorials/intercanister-calls.html#_save_identity_information_for_the_incognito_profile)**
>
> Documentation for the internet computer.

As it only causes confusion for those going through the tutorials.

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [March 14, 2021, 10:17pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/6 "2021-03-14T22:17:56Z")

</div>

Good catch Dylan, maybe @lsgunn can sort this out?

---

<div class="post-metadata">

**Author:** ![Dylan](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dylan/32/18010_2.png) [@Dylan](https://forum.dfinity.org/u/Dylan)\
**Post date:** [March 14, 2021, 10:30pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/7 "2021-03-14T22:30:02Z")

</div>

Going off topic here, but since we’re talking about fixing the “Make inter-canister calls” (LinkedUp) tutorial, this part is also broken:

```
git clone git@github.com:dfinity-lab/linkedup.git

```

Should be:

```
git clone git@github.com:dfinity/linkedup.git
```

---

<div class="post-metadata">

**Author:** ![lsgunn](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lsgunn/32/124_2.png) [@lsgunn](https://forum.dfinity.org/u/lsgunn)\
**Post date:** [March 15, 2021, 10:16pm UTC](https://forum.dfinity.org/t/issue-with-the-public-private-key-pair-storage-strategy/1170/8 "2021-03-15T22:16:41Z")

</div>

Thanks for the ping about the identity storage/cookies issue. I missed the post that described the issue in the Inter-canister calls tutorial. It worked at one point in time (honest!). Sorry that was broken for you. I’ve removed that section for the next deployment of the documentation.

And thanks for catching that the path to the linkedup repo was also out of date. There’s a lot to keep track of, so I really do appreciate the community’s help!
