code: func registerThroughAuth(token string, params RegisterParams) (*Identity, error) {
  	log.Debugf("Attempting to register through auth server.")
  
  	var client *Client
  	var err error
  
  	// Build a client to the Auth Server. If a CA pin is specified require the
  	// Auth Server is validated. Otherwise attempt to use the CA file on disk
  	// but if it's not available connect without validating the Auth Server CA.
  	switch {
  	case params.CAPin != "":
  		client, err = pinRegisterClient(params)
  	default:
  		client, err = insecureRegisterClient(params)
  	}
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	defer client.Close()
  
  	// Get the SSH and X509 certificates for a node.
  	keys, err := client.RegisterUsingToken(RegisterUsingTokenRequest{
  		Token:                token,
  		HostID:               params.ID.HostUUID,
  		NodeName:             params.ID.NodeName,
  		Role:                 params.ID.Role,
  		AdditionalPrincipals: params.AdditionalPrincipals,
  		DNSNames:             params.DNSNames,
  		PublicTLSKey:         params.PublicTLSKey,
  		PublicSSHKey:         params.PublicSSHKey,
  	})
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  	keys.Key = params.PrivateKey
  
  	return ReadIdentityFromKeyPair(keys)
  }
docs: // registerThroughAuth is used to register through the auth server.