examples icon indicating copy to clipboard operation
examples copied to clipboard

Example: Identity

Open johnkruger37 opened this issue 4 years ago • 4 comments

Would it make sense to have an identity (in motoko/) example here?

Move (mirror?) https://github.com/dfinity/internet-identity/tree/main/demos and/or https://github.com/krpeacock/auth-client-demo/ here?

Also re. #76.

johnkruger37 avatar Jun 06 '21 00:06 johnkruger37

https://github.com/dfinity/internet-identity/tree/main/demos and/or https://github.com/krpeacock/auth-client-demo/

Probably best to KISS, and avoid mixing in e.g. krpeacock/auth-client-demo's use of https://lit-html.polymer-project.org (now https://lit.dev?), and leave that to a separate example. Also TS vs JS best left out, as long as dfx new generates JS? Also best a separate example.

Not sure what the simplest controller for a basic identity example would look like... https://github.com/dfinity/internet-identity/blob/main/demos/sample-javascript/src/main.js is 92 lines, https://github.com/krpeacock/auth-client-demo/blob/main/src/frontend/src/index.ts is 39 lines.

It perhaps should not copy/paste whoami a 3rd 😈 time, but use the existing whoami example, which should should link to the new identity example? (The whoami in this examples seems more complete, although perhaps it could do with more docs about it; the shared vs query is not clear, for Noobs; what's the recommendation?)

@krpeacock @nomeata @kritzcreek

johnkruger37 avatar Jun 06 '21 00:06 johnkruger37

FYI I'm toying with this on https://github.com/dfinity/examples/compare/master...johnkruger37:identity. It's not working yet, because I'm hitting an "Invalid combined threshold signature" when trying to login using prod mainnet https://identity.ic0.app from local dev IC http://localhost:8000/.. but it just occurred to me that may be expected? I'll try locally running https://github.com/dfinity/internet-identity some other time, and see if that helps, I'll write up my learning & experiences, and propose a PR.

johnkruger37 avatar Jun 06 '21 12:06 johnkruger37

Yeah, you do need to run identity locally for now. That's the main reason I've held off on writing an official example and have just stuck with my demo project for the meantime

krpeacock avatar Jun 06 '21 18:06 krpeacock