Skip to content

Commit d94428b

Browse files
docs: Update README.md with authentication info
1 parent 58dec41 commit d94428b

File tree

2 files changed

+150
-92
lines changed

2 files changed

+150
-92
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,35 @@
33
The Glean Java SDK provides convenient access to the Glean REST API for Java 8+. It includes POJOs for all API models, fluent builders for requests, and supports both synchronous and asynchronous execution using standard HTTP clients.
44
<!-- No Summary [summary] -->
55

6+
## Unified SDK Architecture
7+
8+
This SDK combines both the Client and Indexing API namespaces into a single unified package:
9+
10+
- **Client API**: Used for search, retrieval, and end-user interactions with Glean content
11+
- **Indexing API**: Used for indexing content, permissions, and other administrative operations
12+
13+
Each namespace has its own authentication requirements and access patterns. While they serve different purposes, having them in a single SDK provides a consistent developer experience across all Glean API interactions.
14+
15+
```java
16+
// Example of accessing Client namespace
17+
Glean glean = Glean.builder()
18+
.bearerAuth("client-token")
19+
.build();
20+
glean.client().search().query()
21+
.searchRequest(SearchRequest.builder().query("search term").build())
22+
.call();
23+
24+
// Example of accessing Indexing namespace
25+
Glean glean = Glean.builder()
26+
.bearerAuth("indexing-token")
27+
.build();
28+
glean.indexing().documents().index()
29+
.request(DocumentBulkIndexRequest.builder() /* document data */ .build())
30+
.call();
31+
```
32+
33+
Remember that each namespace requires its own authentication token type as described in the [Authentication Methods](#authentication-methods) section.
34+
635
<!-- Start Table of Contents [toc] -->
736
## Table of Contents
837
<!-- $toc-max-depth=2 -->
@@ -188,6 +217,35 @@ public class Application {
188217
```
189218
<!-- End Authentication [security] -->
190219

220+
### Authentication Methods
221+
222+
Glean supports different authentication methods depending on which API namespace you're using:
223+
224+
#### Client Namespace
225+
226+
The Client namespace supports two authentication methods:
227+
228+
1. **Manually Provisioned API Tokens**
229+
- Can be created by an Admin or a user with the API Token Creator role
230+
- Used for server-to-server integrations
231+
232+
2. **OAuth**
233+
- Requires OAuth setup to be completed by an Admin
234+
- Used for user-based authentication flows
235+
236+
#### Indexing Namespace
237+
238+
The Indexing namespace supports only one authentication method:
239+
240+
1. **Manually Provisioned API Tokens**
241+
- Can be created by an Admin or a user with the API Token Creator role
242+
- Used for secure document indexing operations
243+
244+
> [!IMPORTANT]
245+
> Client tokens **will not work** for Indexing operations, and Indexing tokens **will not work** for Client operations. You must use the appropriate token type for the namespace you're accessing.
246+
247+
For more information on obtaining the appropriate token type, please contact your Glean administrator.
248+
191249
<!-- Start Available Resources and Operations [operations] -->
192250
## Available Resources and Operations
193251

gradlew.bat

Lines changed: 92 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)