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
Copy file name to clipboardExpand all lines: README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,35 @@ if err != nil {
91
91
92
92
When `DiscoverHosts` is true any nodes are added to the cluster after the initial connection then the new node will be added to the pool of available nodes used by GoRethink. Unfortunately the canonical address of each server in the cluster **MUST** be set as otherwise clients will try to connect to the database nodes locally. For more information about how to set a RethinkDB servers canonical address set this page http://www.rethinkdb.com/docs/config-file/.
93
93
94
+
## User Authentication
95
+
96
+
To login with a username and password you should first create a user, this can be done by writing to the `users` system table and then grant that user access to any tables or databases they need access to. This queries can also be executed in the RethinkDB admin console.
Finally the username and password should be passed to `Connect` when creating your session, for example:
112
+
113
+
```go
114
+
session, err:= r.Connect(r.ConnectOpts{
115
+
Address: "localhost:28015",
116
+
Database: "blog",
117
+
Username: "john",
118
+
Password: "p455w0rd",
119
+
})
120
+
```
121
+
122
+
Please note that `DiscoverHosts` will not work with user authentication at this time due to the fact that RethinkDB restricts access to the required system tables.
0 commit comments