func (c *Client) GenerateToken(roles teleport.Roles, ttl time.Duration) (string, error) {
	out, err := c.PostJSON(c.Endpoint("tokens"), generateTokenReq{
		Roles: roles,
	})
	if err != nil {
		return "", trace.Wrap(err)
	}
	var token string
	if err := json.Unmarshal(out.Bytes(), &token); err != nil {
		return "", trace.Wrap(err)
	}
	return token, nil
}
// GenerateToken creates a special provisioning token for a new SSH server
// that is valid for ttl period seconds.
//
// This token is used by SSH server to authenticate with Auth server
// and get signed certificate and private key from the auth server.
//
// The token can be used only once.
GenerateToken creates a special provisioning token for a new SSH server
that is valid for ttl period seconds.

This token is used by SSH server to authenticate with Auth server
and get signed certificate and private key from the auth server.

The token can be used only once.
// GenerateToken creates a special provisioning token for a new SSH server // that is valid for ttl period seconds . // // This token is used by SSH server to authenticate with Auth server // and get signed certificate and private key from the auth server . // // The token can be used only once .
func (c *Client) GenerateToken(roles teleport.Roles, ttl time.Duration) (string, error) {
	out, err := c.PostJSON(c.Endpoint("tokens"), generateTokenReq{
		Roles: roles,
	})
	if err != nil {
		return "", trace.Wrap(err)
	}
	var token string
	if err := json.Unmarshal(out.Bytes(), &token); err != nil {
		return "", trace.Wrap(err)
	}
	return token, nil
}
func ( c * Client ) GenerateToken ( roles teleport . Roles , ttl time . Duration ) ( string , error ) { out , err := c . PostJSON ( c . Endpoint ( " " ) , generateTokenReq { Roles : roles , } ) if err != nil { return " " , trace . Wrap ( err ) } var token string if err := json . Unmarshal ( out . Bytes ( ) , & token ) ; err != nil { return " " , trace . Wrap ( err ) } return token , nil }
GenerateToken creates a special provisioning token for a new SSH server
that is valid for ttl period seconds.
GenerateToken creates a special provisioning token for a new SSH server that is valid for ttl period seconds .