Anonymous authentication
Note
The article is being updated.
Below are examples of the code for anonymous authentication in different YDB SDKs.
Go
Java
1. package main
3. import (
4. "context"
6. "github.com/ydb-platform/ydb-go-sdk/v3"
7. )
9. func main() {
10. ctx, cancel := context.WithCancel(context.Background())
11. defer cancel()
12. db, err := ydb.Open(
13. ctx,
14. os.Getenv("YDB_CONNECTION_STRING"),
15. ydb.WithAnonymousCredentials(),
16. )
17. if err != nil {
18. panic(err)
19. }
20. defer func() {
21. _ = db.Close(ctx)
22. }()
23. }

1. public void work(String connectionString) {
2. AuthProvider authProvider = NopAuthProvider.INSTANCE;
4. GrpcTransport transport = GrpcTransport.forConnectionString(connectionString)
5. .withAuthProvider(authProvider)
6. .build();
8. TableClient tableClient = TableClient
9. .newClient(GrpcTableRpc.ownTransport(transport))
10. .build());
12. doWork(tableClient);
14. tableClient.close();
15. }

