`internet_identity_frontend` is now a pullable DFX dependency

For those of you who still use DFX for local development, here’s how to set up Internet Identity frontend as a pullable dependency in your dfx.json file.

{
  "dfx": "0.31.0",
  "canisters": {
    "internet_identity": {
      "type": "pull",
      "id": "rdmx6-jaaaa-aaaaa-aaadq-cai"
    },
    "internet_identity_frontend": {
      "type": "pull",
      "id": "uqzsh-gqaaa-aaaaq-qaada-cai",
    }
  },
  "version": 1
}

To deploy the default local network (port 4943):

rm -r deps
dfx start --clean --background
dfx deps pull
dfx deps init
dfx deps deploy

Internet Identity should be available at http://uqzsh-gqaaa-aaaaq-qaada-cai.localhost:4943.

Read this if you wish to start the DFX network on a non-standard port (e.g., 8080)
rm -r deps
dfx start --clean --background --host 127.0.0.1:8080
dfx deps pull
dfx deps init internet_identity_frontend --argument '(record {
    backend_canister_id = principal "rdmx6-jaaaa-aaaaa-aaadq-cai";
    related_origins = opt vec { "http://uqzsh-gqaaa-aaaaq-qaada-cai.localhost:8080" };
    backend_origin = "http://rdmx6-jaaaa-aaaaa-aaadq-cai.localhost:8080";
    dev_csp = opt true;
})'
dfx deps init
dfx deps deploy

Internet Identity should be available at http://uqzsh-gqaaa-aaaaq-qaada-cai.localhost:8080.

Note that uqzsh-gqaaa-aaaaq-qaada-cai (and not rdmx6-... any more) should now be the argument passed to authClient.

PS. Instructions for ICP-CLI coming shortly.

1 Like