@@ -74,7 +74,7 @@ JSON file. This process creates a secure token.
7474** Example:**
7575
7676``` php
77- use \ Zitadel\Client\Zitadel;
77+ use Zitadel\Client\Zitadel;
7878
7979$zitadel = Zitadel::withPrivateKey("https://example.us1.zitadel.cloud", "path/to/jwt-key.json");
8080
9393 echo "User created: " . print_r($response, true);
9494} catch (ApiException $e) {
9595 echo "Error: " . $e->getMessage();
96+ }
9697```
9798
9899#### 2. Client Credentials Grant
@@ -116,9 +117,8 @@ which is then used to authenticate.
116117``` php
117118use Zitadel\Client\Zitadel;
118119use Zitadel\Client\Model\UserServiceAddHumanUserRequest;
119- use \Zitadel\Client\Model\UserServiceAddHumanUserRequest;
120- use \Zitadel\Client\Model\UserServiceSetHumanProfile;
121- use \Zitadel\Client\Model\UserServiceSetHumanEmail;
120+ use Zitadel\Client\Model\UserServiceSetHumanProfile;
121+ use Zitadel\Client\Model\UserServiceSetHumanEmail;
122122
123123$zitadel = Zitadel::withClientCredentials("https://example.us1.zitadel.cloud", "id", "secret");
124124
@@ -159,12 +159,10 @@ authenticate without exchanging credentials every time.
159159** Example:**
160160
161161``` php
162- use \Zitadel\Client\Zitadel;
163162use Zitadel\Client\Zitadel;
164163use Zitadel\Client\Model\UserServiceAddHumanUserRequest;
165- use \Zitadel\Client\Model\UserServiceAddHumanUserRequest;
166- use \Zitadel\Client\Model\UserServiceSetHumanProfile;
167- use \Zitadel\Client\Model\UserServiceSetHumanEmail;
164+ use Zitadel\Client\Model\UserServiceSetHumanProfile;
165+ use Zitadel\Client\Model\UserServiceSetHumanEmail;
168166
169167$zitadel = Zitadel::withAccessToken("https://example.us1.zitadel.cloud", "token");
170168
@@ -194,6 +192,90 @@ Choose the authentication method that best suits your needs based on your
194192environment and security requirements. For more details, please refer to the
195193[ Zitadel documentation on authenticating service users] ( https://zitadel.com/docs/guides/integrate/service-users/authenticate-service-users ) .
196194
195+ ## Advanced Configuration
196+
197+ The SDK provides a ` TransportOptions ` object that allows you to customise
198+ the underlying HTTP transport used for both OpenID discovery and API calls.
199+
200+ ### Disabling TLS Verification
201+
202+ In development or testing environments with self-signed certificates, you can
203+ disable TLS verification entirely:
204+
205+ ``` php
206+ use Zitadel\Client\Zitadel;
207+ use Zitadel\Client\TransportOptions;
208+
209+ $options = new TransportOptions(insecure: true);
210+
211+ $zitadel = Zitadel::withClientCredentials(
212+ 'https://your-instance.zitadel.cloud',
213+ 'client-id',
214+ 'client-secret',
215+ $options,
216+ );
217+ ```
218+
219+ ### Using a Custom CA Certificate
220+
221+ If your Zitadel instance uses a certificate signed by a private CA, you can
222+ provide the path to the CA certificate in PEM format:
223+
224+ ``` php
225+ use Zitadel\Client\Zitadel;
226+ use Zitadel\Client\TransportOptions;
227+
228+ $options = new TransportOptions(caCertPath: '/path/to/ca.pem');
229+
230+ $zitadel = Zitadel::withClientCredentials(
231+ 'https://your-instance.zitadel.cloud',
232+ 'client-id',
233+ 'client-secret',
234+ $options,
235+ );
236+ ```
237+
238+ ### Custom Default Headers
239+
240+ You can attach default headers to every outgoing request. This is useful for
241+ custom routing or tracing headers:
242+
243+ ``` php
244+ use Zitadel\Client\Zitadel;
245+ use Zitadel\Client\TransportOptions;
246+
247+ $options = new TransportOptions(
248+ defaultHeaders: ['X-Custom-Header' => 'my-value'],
249+ );
250+
251+ $zitadel = Zitadel::withClientCredentials(
252+ 'https://your-instance.zitadel.cloud',
253+ 'client-id',
254+ 'client-secret',
255+ $options,
256+ );
257+ ```
258+
259+ ### Proxy Configuration
260+
261+ If your environment requires routing traffic through an HTTP proxy, you can
262+ specify the proxy URL. To authenticate with the proxy, embed the credentials
263+ directly in the URL:
264+
265+ ``` php
266+ use Zitadel\Client\Zitadel;
267+ use Zitadel\Client\TransportOptions;
268+
269+ $options = new TransportOptions(proxyUrl: 'http://user:pass@proxy:8080');
270+
271+ $zitadel = Zitadel::withClientCredentials(
272+ 'https://your-instance.zitadel.cloud',
273+ 'client-id',
274+ 'client-secret',
275+ $options,
276+ );
277+ ```
278+
197279## Design and Dependencies
198280
199281This SDK is designed to be lean and efficient, focusing on providing a
0 commit comments