Skip to content

Commit e2a0db3

Browse files
committed
chore: Update Graph client initialization samples in README
1 parent 10a8263 commit e2a0db3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,23 @@ The nature of the Graph API is such that the SDK needs quite a large set of clas
5959

6060
Register your application by following the steps at [Register your app with the Microsoft Identity Platform](https://docs.microsoft.com/graph/auth-register-app-v2).
6161

62-
### 2.2 Create an IAuthenticationProvider object
62+
### 2.2 Create an AuthenticationProvider object
6363

64-
An instance of the **HttpClients** class handles building client. To create a new instance of this class, you need to provide an instance of `IAuthenticationProvider`, which can authenticate requests to Microsoft Graph.
64+
[Initialize an `AuthenticationProvider`](https://learn.microsoft.com/en-us/graph/sdks/choose-authentication-providers?view=graph-rest-1.0&tabs=java) based on your preferred authentication flow
6565

66-
For an example of how to get an authentication provider, see [choose a Microsoft Graph authentication provider](https://docs.microsoft.com/graph/sdks/choose-authentication-providers?tabs=Java).
66+
### 2.3 Get a OkHttpClient object
6767

68-
### 2.3 Get a HttpClients object
68+
You must get an **OkHttpClient** object to make requests against the service.
6969

70-
You must get a **HttpClients** object to make requests against the service.
70+
Using the `GraphClientFactory`, you can initialize an `OkHttpClient` pre-configured for use with Microsoft Graph
7171

7272
```java
73-
OkHttpClient client = HttpClients.createDefault(iAuthenticationProvider);
73+
OkHttpClient client = GraphClientFactory.create(authenticationProvider).build();
7474
```
7575

7676
## 3. Make requests against the service
7777

78-
After you have a HttpClients that is authenticated, you can begin making calls against the service. The requests against the service look like our [REST API](https://developer.microsoft.com/en-us/graph/docs/concepts/overview).
78+
After you have an OkHttpClient that is authenticated, you can begin making calls against the service. The requests against the service look like our [REST API](https://developer.microsoft.com/en-us/graph/docs/concepts/overview).
7979

8080
### 3.1 Get the user's details
8181

0 commit comments

Comments
 (0)