This program demonstrates how to...
- Authenticate the client using credential loaders.
- Authorize API calls using an independent user and role.
- Create a new client and make API calls to the Auth server.
This demo can be used to quickly get the API client up and running.
Create the access-admin
user and role using the following commands:
$ tctl create -f access-admin.yaml
$ tctl users add access-admin --roles=access-admin
Login with tsh
to generate Profile credentials.
# login and automatically generate keys
$ tsh login --user=access-admin
NOTE: You can pass the InsecureAddressDiscovery
in client.Config
field to skip verification of the TLS certificate of the proxy. Don't do this for production clients.
$ go run main.go
To see more information on the Go Client and how to use it, visit our API documentation: