Files
teleport/examples/go-client
Mike Jensen 06f5501c96 Update golang/x/crypto to 0.17.0 (#35858)
This updates crypto across all go.mod files in `teleport` to address CVE-2023-48795.
2023-12-18 20:06:25 +00:00
..
2022-11-04 15:46:46 +00:00

Teleport Auth Go Client

This program demonstrates how to...

  1. Authenticate the client using credential loaders.
  2. Authorize API calls using an independent user and role.
  3. Create a new client and make API calls to the Auth server.

Demo

This demo can be used to quickly get the API client up and running.

Create resources

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
Generate Credentials

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.

Run
$ go run main.go

Reference

To see more information on the Go Client and how to use it, visit our API documentation: