- Repo names: ziti-* → zt-* - Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt - Docker images: hanzozt/ziti-* → hanzozt/zt-* - C/Java/JS symbols: ziti_* → zt_* - File and directory names updated
jwtchat
A set of three binaries used to demonstrate the Hanzo ZT GoLang SDK using external JWT signers to athenticate.
Binaries
jwtchat-idp
Stands up an OIDC compliant OpenId Provider (OP) that allows all OIDC flows. This example uses Client Credentials.
It is run without any arguments and host the OPIDC API on localhost:9998
jwtchat-client
Attempts to contact a controller listening on localhost:1280 and an OIDC compliant provider on localhost:9998.
It is run without any arguments and does not open any ports. It attempts to connection/dial a service named jwtchat
It will attempt to authenticate with the OIDC provider as:
- username:
cid1 - password:
cid1secreat
jwtchat-server
Attempts to contact a controller listening on localhost:1280 and an OIDC compliant provider on localhost:9998.
It is run without any arguments and does not open any ports. It attempts to host/bind a service named jwtchat
It will attempt to authenticate with the OIDC provider as:
- username:
cid2 - password:
cid2secreat
Setup
Note: For Powershell ensure you escape pound (#) symbols with a grave tick (`)
- Stand up an Hanzo ZT network
- Add an External JWT Signer with a JWKS endpoint
zt edge create ext-jwt-signer jwtchat-idp "http://localhost:9998" -a hanzozt -u "http://localhost:9998/keys"- Save the resulting
ext-jwt-signer
- Create an authentication policy that allows the new
ext-jwt-signerto authenticate identitieszt edge create auth-policy jwtchat --primary-ext-jwt-allowed --primary-ext-jwt-allowed-signers <extjwtIdFromStep2>- Save the resulting
auth-policyid
- Create two identities (client, server)
zt edge create identity service cid1 --external-id cid1 -a jwtchat -P <authPolicyIdFromStep3>zt edge create identity service cid2 --external-id cid2 -a jwtchat -P <authPolicyIdFromStep3>
- Create at least one Edge Router
zt edge create edge-router myRouter <myRouter.yml> -o myRouter.jwtzt router enroll <myRouter.yml> -j myRouter.jwt
- Create a service named
jwtchatwith attributejwtchatzt edge create service jwtchat -a jwtchat
- Creat an Edge Router Policy that gives the new identities access to your Edge Routers
zt edge create edge-router-policy jwtchat --identity-roles #jwtchat --edge-router-roles #all
- Create a Service Edge Router Policy that allows
jwtchatservice usage on your Edge Routerszt edge create service-edge-router-policy jwtchat --service-roles #jwtchat --edge-router-roles #all
- Create a Service Policy that allows your identities access to the
jwtchatservicezt edge create service-policy jwtchatDial Dial --service-roles #jwtchat --identity-roles #jwtchatzt edge create service-policy jwtchatBind Bind --service-roles #jwtchat --identity-roles #jwtchat
- Start the
jwtchat-idpprocess - Start the
jwtchat-serverprocess - Start the
jwtchat-clientprocess