Skip to content

Commit 4796529

Browse files
committed
Update Readme and Examples
1 parent 78edccb commit 4796529

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

EXAMPLES.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,22 @@ AuthAPI auth = AuthAPI.newBuilder("DOMAIN", "CLIENT-ID", "CLIENT-SECRET")
3838
.withHttpClient(client)
3939
.build();
4040

41+
```
42+
43+
```java
44+
4145
ManagementAPI mgmt = ManagementAPI.newBuilder("DOMAIN", "API-TOKEN")
4246
.withHttpClient(client)
4347
.build();
48+
49+
// OR
50+
51+
TokenProvider tokenProvider = SimpleTokenProvider.create("API-TOKEN");
52+
53+
ManagementAPI mgmt = ManagementAPI.newBuilder("DOMAIN", tokenProvider)
54+
.withHttpClient(client)
55+
.build();
56+
4457
```
4558

4659
If the `DefaultHttpClient` does not support your required networking client configuration, you may choose to implement

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ Create a `ManagementAPI` instance by providing the domain from the [Application
6666
ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build();
6767
```
6868

69+
OR
70+
71+
Create a `ManagementAPI` instance by providing the domain from the [Application dashboard](https://manage.auth0.com/#/applications) and Token Provider.
72+
73+
```java
74+
TokenProvider tokenProvider = SimpleTokenProvider.create("{YOUR_API_TOKEN}");
75+
ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", TokenProvider).build();
76+
```
77+
6978
The Management API is organized by entities represented by the Auth0 Management API objects.
7079

7180
```java

0 commit comments

Comments
 (0)