How energywebfoundation/iam-client-examples works
This repository is a set of IAM client examples: users authenticate with wallet-backed DIDs and identity proofs, then receive validated roles from an Express backend. React and Angular demonstrate the browser flow; delegate-auth demonstrates asset registration and delegated proof; jwt-authentication demonstrates manual token creation and login. The README documents backend role checks and optional enrolment. Some wiring is inferred only from documentation because server passport and several UI sources were not sampled.
Main entry points: index.js Express API · delegate-auth-script.ts Delegate workflow · App.tsx React demo · login.service.ts Angular login
Components 17
Web clients
- React demo
client/react-dapp/src/App.tsx - Angular login
client/angular-dapp/src/app/services/login/login.service.ts - Role display
client/angular-dapp/src/app/services/roles/roles.service.ts - Enrolment link
client/react-dapp/src/config.ts
Auth backend
- Express API
server/express/index.js - DID/JWT auth
server/express/passport.js - Cookie policy
server/express/cookies.js
Delegate example
- Delegate workflow
client/delegate-auth/delegate-auth-script.ts - Registered asset
client/delegate-auth/delegate-auth-script.ts
JWT example
- JWT login example
client/jwt-authentication/jwt-login.ts - Identity token generator
client/jwt-authentication/generate-identity.ts
Other components
- User
- Wallet provider
- IAM client library
- Role claims
- Chain RPC
- Identity cache
Connections 22
- User → React demo: uses demo
- User → Angular login: uses demo
- React demo → Wallet provider: selects provider
- Angular login → Wallet provider: selects provider
- React demo → IAM client library: creates identity proof
- Angular login → IAM client library: creates identity proof
- React demo → Express API: posts proof; requests roles
- Angular login → Express API: posts proof
- Role display → Express API: requests roles
- Express API → DID/JWT auth: authenticates requests
- Express API → Cookie policy: sets production cookies
- DID/JWT auth → Role claims: validates role claims
- DID/JWT auth → Chain RPC: verifies DID
- DID/JWT auth → Identity cache: resolves identity
- React demo → Enrolment link: offers enrolment link
- Delegate workflow → IAM client library: initializes IAM; creates proof
- Delegate workflow → Registered asset: registers asset; adds key
- Delegate workflow → Express API: submits delegate proof
- Delegate workflow → Chain RPC: uses configured RPC
- Delegate workflow → Identity cache: configures cache
- JWT login example → Identity token generator: generates identity token
- JWT login example → Express API: submits login token