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
public_key?:<public key> (if a refresh token is needed),
41
+
claims: {
42
+
sub:<userid>,
43
+
email:<email>,
44
+
name:<name of user to authenticate>
45
+
}
38
46
}
39
47
```
40
48
49
+
See a [sample code to call this endpoint to authenticate end users](db.cloud.configure()#example-integrate-custom-authentication).
50
+
51
+
A client must be given the "IMPERSONATE" scope in order to call this endpoint.
52
+
53
+
#### scopes
54
+
55
+
If you use the endpoint to give out tokens for web users, the "ACCESS_DB" scope is the only one to use. If you however, need to generate a token for a server application to use the "/all/..." endpoint, you might want to request a "GLOBAL_READ" or "GLOBAL_WRITE" scope depending on whether the integration should be allowed to read or write to the database within any realm.
56
+
57
+
### /all/... endpoint
58
+
59
+
**Get all objects in given table:**
60
+
61
+
```http
62
+
GET /all/<table> HTTP/1.1
63
+
Authorization: Bearer <token from /token endpoint (with GLOBAL_READ scope)>
64
+
```
65
+
66
+
**Get all objects in given table and realm:**
67
+
68
+
```http
69
+
GET /all/<table>?realmId=<realmId> HTTP/1.1
70
+
Authorization: Bearer <token from /token endpoint (with GLOBAL_READ scope)>
71
+
```
72
+
73
+
**Get all objects in given table with a filter:**
74
+
75
+
```http
76
+
GET /all/<table>?<propName>=<propValue>&<propName2>=<propValue2>&... HTTP/1.1
77
+
Authorization: Bearer <token from /token endpoint (with GLOBAL_READ scope)>
78
+
```
79
+
80
+
This request will filter the query to only return matching objects. A concrete example:
81
+
82
+
```http
83
+
GET /all/todoItems?todoListId=xxx HTTP/1.1
84
+
Authorization: Bearer <token from /token endpoint (with GLOBAL_READ scope)>
85
+
```
86
+
87
+
*This example would give you all todoItems that has the property todoListId set to "xxx".*
88
+
89
+
**Get simple object by primary key:**
90
+
91
+
```http
92
+
GET /all/<table>/<primary key> HTTP/1.1
93
+
Authorization: Bearer <token from /token endpoint (with GLOBAL_READ scope)>
94
+
```
95
+
96
+
### /my/... endpoint
97
+
98
+
The /my/... endpoint works exactly like the /all/... endpoint, except that it doesn't search the global database but can only return objects that are accessible for the token subject.
99
+
100
+
```http
101
+
GET /my/<table> HTTP/1.1
102
+
Authorization: Bearer <token from /token endpoint (with ACCESS_DB scope)>
103
+
```
104
+
105
+
The token to use should be given out to a certain subject (userId) with the "ACCESS_DB" scope only.
106
+
107
+
**Example:**
108
+
109
+
```http
110
+
GET /my/todoLists HTTP/1.1
111
+
Authorization: Bearer <token from /token endpoint (with ACCESS_DB scope)>
112
+
```
113
+
114
+
*Lists all todoLists that the user has at least readonly access to. Either their own private lists or todo-lists that have been shared to the user.*
115
+
116
+
### /public/... endpoint
117
+
118
+
The /public/... endpoint works exactly list the /all/... and /my/... endpoints except that it will only access public data - i.e. data that resides in the public realm "rlm-public". This endpoint does not require authorization.
0 commit comments