dfinity / examples

Example applications, microservices, and code samples for the Internet Computer
https://dfinity.org
Apache License 2.0
508 stars 321 forks source link

Example: Identity #99

Open johnkruger37 opened 3 years ago

johnkruger37 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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.

krpeacock commented 3 years ago

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

github-actions[bot] commented 4 days ago

This issue is stale because it has been open for 30 days with no activity.