You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'root_cert_file' => './CA.pem', // Root CA file (dedicated server only!)
154
+
],
155
+
156
+
'credentials' => new OAuthTokenAuthentication('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA')
157
+
];
158
+
159
+
$ydb = new Ydb($config);
160
+
```
104
161
## JWT + private key
105
162
106
163
Create [a service account](https://cloud.yandex.com/docs/iam/operations/sa/create) with the `editor` role, then create a private key. Also you need a key ID and a service account ID.
@@ -128,10 +185,36 @@ $config = [
128
185
];
129
186
130
187
$ydb = new Ydb($config);
131
-
132
188
```
133
189
190
+
or
191
+
```php
192
+
<?php
193
+
194
+
use YdbPlatform\Ydb\Ydb;
195
+
use YdbPlatform\Ydb\Auth\JwtWithPrivateKeyAuthentication;
'root_cert_file' => './CA.pem', // Root CA file (dedicated server only!)
261
+
],
262
+
263
+
'credentials' => new JwtWithJsonAuthentication('./jwtjson.json')
264
+
];
265
+
266
+
$ydb = new Ydb($config);
267
+
```
164
268
## Metadata URL
165
269
166
270
When you deploy a project to VM or function at Yandex.Cloud, you are able to connect to the database using [Metadata URL](https://cloud.yandex.com/docs/compute/operations/vm-connect/auth-inside-vm). Before you start, you should link your service account to an existing or new VM or function.
0 commit comments