Skip to content

Commit f889ca5

Browse files
committed
add javadocs to all classses
1 parent 5c551f6 commit f889ca5

100 files changed

Lines changed: 2554 additions & 526 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/compiler.xml

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

src/main/java/com/auth0/client/auth/AuthAPI.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package com.auth0.client.auth;
22

3-
import com.auth0.utils.Asserts;
43
import com.auth0.json.auth.UserInfo;
54
import com.auth0.net.*;
5+
import com.auth0.utils.Asserts;
66
import com.fasterxml.jackson.core.type.TypeReference;
77
import okhttp3.HttpUrl;
88
import okhttp3.OkHttpClient;
99
import okhttp3.logging.HttpLoggingInterceptor;
1010
import okhttp3.logging.HttpLoggingInterceptor.Level;
1111

12+
/**
13+
* Class that provides an implementation of some of the Authentication and Authorization API methods defined in https://auth0.com/docs/api/authentication.
14+
* To begin create a new instance of {@link #AuthAPI(String, String, String)} using the tenant domain, client id and client secret.
15+
*/
16+
@SuppressWarnings("WeakerAccess")
1217
public class AuthAPI {
1318

1419
private static final String KEY_CLIENT_ID = "client_id";
@@ -31,6 +36,13 @@ public class AuthAPI {
3136
private final TelemetryInterceptor telemetry;
3237
private final HttpLoggingInterceptor logging;
3338

39+
/**
40+
* Create a new instance with the given tenant's domain, client id and client secret. These values can be obtained at https://manage.auth0.com/#/clients/{YOUR_CLIENT_ID}/settings.
41+
*
42+
* @param domain tenant's domain.
43+
* @param clientId the client's id.
44+
* @param clientSecret the client's secret.
45+
*/
3446
public AuthAPI(String domain, String clientId, String clientSecret) {
3547
Asserts.assertNotNull(domain, "domain");
3648
Asserts.assertNotNull(clientId, "client id");
@@ -98,11 +110,11 @@ public AuthorizeUrlBuilder authorizeUrl(String redirectUri) {
98110
}
99111

100112
/**
101-
* Creates a new instance of the {@link AuthorizeUrlBuilder} with the given connection and redirect url parameters.
113+
* Creates a new instance of the {@link LogoutUrlBuilder} with the given return-to url.
102114
*
103115
* @param returnToUrl the redirect_uri value to set, white-listed in the client settings. Must be already URL Encoded.
104116
* @param setClientId whether the client_id value must be set or not. This affects the white-list that the Auth0's Dashboard uses to validate the returnTo url.
105-
* @return a new instance of the {@link AuthorizeUrlBuilder} to configure.
117+
* @return a new instance of the {@link LogoutUrlBuilder} to configure.
106118
*/
107119
public LogoutUrlBuilder logoutUrl(String returnToUrl, boolean setClientId) {
108120
Asserts.assertNotNull(returnToUrl, "return to url");
@@ -257,7 +269,7 @@ public AuthRequest login(String emailOrUsername, String password, String realm)
257269
}
258270

259271
/**
260-
* Creates a new request using the 'Client Credentials' grant to get a Token for the given audience.
272+
* Creates a new request to get a Token for the given audience using the 'Client Credentials' grant.
261273
* Default used realm and audience are defined in the "API Authorization Settings" in the account's advanced settings in the Auth0 Dashboard.
262274
*
263275
* @param audience the audience of the API to request access to.
@@ -281,7 +293,7 @@ public AuthRequest requestToken(String audience) {
281293
}
282294

283295
/**
284-
* Creates a new request using the 'Authorization Code' grant to exchange the code obtained in the /authorize call.
296+
* Creates a new request to exchange the code obtained in the /authorize call using the 'Authorization Code' grant.
285297
*
286298
* @param code the authorization code received from the /authorize call.
287299
* @param redirectUri the redirect uri sent on the /authorize call.

src/main/java/com/auth0/client/auth/AuthorizeUrlBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import static com.auth0.utils.Asserts.assertNotNull;
99
import static com.auth0.utils.Asserts.assertValidUrl;
1010

11+
/**
12+
* Class that provides the methods to generate a valid Auth0 Authorize Url. It's based on the https://auth0.com/docs/api/authentication#social docs.
13+
*/
1114
public class AuthorizeUrlBuilder {
1215

1316
private final HttpUrl.Builder builder;

src/main/java/com/auth0/client/auth/LogoutUrlBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import static com.auth0.utils.Asserts.assertNotNull;
99
import static com.auth0.utils.Asserts.assertValidUrl;
1010

11+
/**
12+
* Class that provides the methods to generate a valid Auth0 Logout Url. It's based on the https://auth0.com/docs/api/authentication#logout docs.
13+
*/
1114
public class LogoutUrlBuilder {
1215

1316
private final HttpUrl.Builder builder;

src/main/java/com/auth0/client/mgmt/BlacklistsEntity.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package com.auth0.client.mgmt;
22

3-
import com.auth0.utils.Asserts;
43
import com.auth0.json.mgmt.Token;
54
import com.auth0.net.CustomRequest;
65
import com.auth0.net.Request;
76
import com.auth0.net.VoidRequest;
7+
import com.auth0.utils.Asserts;
88
import com.fasterxml.jackson.core.type.TypeReference;
99
import okhttp3.HttpUrl;
1010
import okhttp3.OkHttpClient;
1111

1212
import java.util.List;
1313

14+
/**
15+
* Class that provides an implementation of the Blacklists methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Blacklists
16+
*/
17+
@SuppressWarnings("WeakerAccess")
1418
public class BlacklistsEntity extends BaseManagementEntity {
1519

1620
BlacklistsEntity(OkHttpClient client, String baseUrl, String apiToken) {
@@ -19,6 +23,7 @@ public class BlacklistsEntity extends BaseManagementEntity {
1923

2024
/**
2125
* Request all the Blacklisted Tokens with a given audience. A token with scope blacklist:tokens is needed.
26+
* See https://auth0.com/docs/api/management/v2#!/Blacklists/get_tokens.
2227
*
2328
* @param audience the token audience (aud).
2429
* @return a Request to execute.
@@ -43,6 +48,7 @@ public Request<List<Token>> getBlacklist(String audience) {
4348

4449
/**
4550
* Add a Token to the Blacklist. A token with scope blacklist:tokens is needed.
51+
* See https://auth0.com/docs/api/management/v2#!/Blacklists/post_tokens.
4652
*
4753
* @param token the token to blacklist.
4854
* @return a Request to execute.

src/main/java/com/auth0/client/mgmt/ClientGrantsEntity.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
package com.auth0.client.mgmt;
22

3-
import com.auth0.utils.Asserts;
43
import com.auth0.json.mgmt.ClientGrant;
54
import com.auth0.net.CustomRequest;
65
import com.auth0.net.Request;
76
import com.auth0.net.VoidRequest;
7+
import com.auth0.utils.Asserts;
88
import com.fasterxml.jackson.core.type.TypeReference;
99
import okhttp3.HttpUrl;
1010
import okhttp3.OkHttpClient;
1111

1212
import java.util.List;
1313

14+
/**
15+
* Class that provides an implementation of the Client Grants methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Client_Grants
16+
*/
17+
@SuppressWarnings("WeakerAccess")
1418
public class ClientGrantsEntity extends BaseManagementEntity {
1519

1620
ClientGrantsEntity(OkHttpClient client, String baseUrl, String apiToken) {
@@ -19,6 +23,7 @@ public class ClientGrantsEntity extends BaseManagementEntity {
1923

2024
/**
2125
* Request all the Client Grants. A token with scope read:client_grants is needed.
26+
* See https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants
2227
*
2328
* @return a Request to execute.
2429
*/
@@ -38,6 +43,7 @@ public Request<List<ClientGrant>> list() {
3843

3944
/**
4045
* Create a new Client Grant. A token with scope create:client_grants is needed.
46+
* See https://auth0.com/docs/api/management/v2#!/Client_Grants/post_client_grants
4147
*
4248
* @param clientId the client id to associate this grant with.
4349
* @param audience the audience of the grant.
@@ -68,6 +74,7 @@ public Request<ClientGrant> create(String clientId, String audience, String[] sc
6874

6975
/**
7076
* Delete an existing Client Grant. A token with scope delete:client_grants is needed.
77+
* See https://auth0.com/docs/api/management/v2#!/Client_Grants/delete_client_grants_by_id
7178
*
7279
* @param clientGrantId the client grant id.
7380
* @return a Request to execute.
@@ -90,6 +97,7 @@ public Request delete(String clientGrantId) {
9097

9198
/**
9299
* Update an existing Client Grant. A token with scope update:client_grants is needed.
100+
* See https://auth0.com/docs/api/management/v2#!/Client_Grants/patch_client_grants_by_id
93101
*
94102
* @param clientGrantId the client grant id.
95103
* @param scope the scope to grant.

src/main/java/com/auth0/client/mgmt/ClientsEntity.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
package com.auth0.client.mgmt;
22

3-
import com.auth0.utils.Asserts;
43
import com.auth0.json.mgmt.client.Client;
54
import com.auth0.net.CustomRequest;
65
import com.auth0.net.EmptyBodyRequest;
76
import com.auth0.net.Request;
87
import com.auth0.net.VoidRequest;
8+
import com.auth0.utils.Asserts;
99
import com.fasterxml.jackson.core.type.TypeReference;
1010
import okhttp3.HttpUrl;
1111
import okhttp3.OkHttpClient;
1212

1313
import java.util.List;
1414

15+
/**
16+
* Class that provides an implementation of the Clients methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Clients
17+
*/
18+
@SuppressWarnings("WeakerAccess")
1519
public class ClientsEntity extends BaseManagementEntity {
1620

1721
ClientsEntity(OkHttpClient client, String baseUrl, String apiToken) {
@@ -20,6 +24,7 @@ public class ClientsEntity extends BaseManagementEntity {
2024

2125
/**
2226
* Request all the ClientsEntity. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope.
27+
* See https://auth0.com/docs/api/management/v2#!/Clients/get_clients
2328
*
2429
* @return a Request to execute.
2530
*/
@@ -39,6 +44,7 @@ public Request<List<Client>> list() {
3944

4045
/**
4146
* Request a Client. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope.
47+
* See https://auth0.com/docs/api/management/v2#!/Clients/get_clients_by_id
4248
*
4349
* @param clientId the client id.
4450
* @return a Request to execute.
@@ -62,6 +68,7 @@ public Request<Client> get(String clientId) {
6268

6369
/**
6470
* Create a new Client. A token with scope create:clients is needed.
71+
* See https://auth0.com/docs/api/management/v2#!/Clients/post_clients
6572
*
6673
* @param client the client data to set.
6774
* @return a Request to execute.
@@ -85,6 +92,7 @@ public Request<Client> create(Client client) {
8592

8693
/**
8794
* Delete an existing Client. A token with scope delete:clients is needed.
95+
* See https://auth0.com/docs/api/management/v2#!/Clients/delete_clients_by_id
8896
*
8997
* @param clientId the client id.
9098
* @return a Request to execute.
@@ -107,6 +115,7 @@ public Request delete(String clientId) {
107115

108116
/**
109117
* Update an existing Client. A token with scope update:clients is needed. If you also need to update the client_secret and encryption_key attributes the token must have update:client_keys scope.
118+
* See https://auth0.com/docs/api/management/v2#!/Clients/patch_clients_by_id
110119
*
111120
* @param clientId the client id.
112121
* @param client the client data to set.
@@ -133,6 +142,7 @@ public Request<Client> update(String clientId, Client client) {
133142

134143
/**
135144
* Rotates a Client secret. A token with scope update:client_keys is needed. Note that the generated secret is NOT base64 encoded.
145+
* See https://auth0.com/docs/api/management/v2#!/Clients/post_rotate_secret
136146
*
137147
* @param clientId the client id.
138148
* @return a Request to execute.

src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
package com.auth0.client.mgmt;
22

3-
import com.auth0.utils.Asserts;
43
import com.auth0.client.mgmt.filter.ConnectionFilter;
54
import com.auth0.json.mgmt.Connection;
65
import com.auth0.net.CustomRequest;
76
import com.auth0.net.Request;
87
import com.auth0.net.VoidRequest;
8+
import com.auth0.utils.Asserts;
99
import com.fasterxml.jackson.core.type.TypeReference;
1010
import okhttp3.HttpUrl;
1111
import okhttp3.OkHttpClient;
1212

1313
import java.util.List;
1414
import java.util.Map;
1515

16+
/**
17+
* Class that provides an implementation of the Clients methods of the Management API as defined in https://auth0.com/docs/api/management/v2#!/Connections
18+
*/
19+
@SuppressWarnings("WeakerAccess")
1620
public class ConnectionsEntity extends BaseManagementEntity {
1721

1822
ConnectionsEntity(OkHttpClient client, String baseUrl, String apiToken) {
@@ -21,6 +25,7 @@ public class ConnectionsEntity extends BaseManagementEntity {
2125

2226
/**
2327
* Request all the ConnectionsEntity. A token with scope read:connections is needed.
28+
* See https://auth0.com/docs/api/management/v2#!/Connections/get_connections
2429
*
2530
* @param filter the filter to use. Can be null.
2631
* @return a Request to execute.
@@ -45,6 +50,7 @@ public Request<List<Connection>> list(ConnectionFilter filter) {
4550

4651
/**
4752
* Request a Connection. A token with scope read:connections is needed.
53+
* See https://auth0.com/docs/api/management/v2#!/Connections/get_connections_by_id
4854
*
4955
* @param connectionId the id of the connection to retrieve.
5056
* @param filter the filter to use. Can be null.
@@ -73,6 +79,7 @@ public Request<Connection> get(String connectionId, ConnectionFilter filter) {
7379

7480
/**
7581
* Create a new Connection. A token with scope create:connections is needed.
82+
* See https://auth0.com/docs/api/management/v2#!/Connections/post_connections
7683
*
7784
* @param connection the connection data to set.
7885
* @return a Request to execute.
@@ -96,6 +103,7 @@ public Request<Connection> create(Connection connection) {
96103

97104
/**
98105
* Delete an existing Connection. A token with scope delete:connections is needed.
106+
* See https://auth0.com/docs/api/management/v2#!/Connections/delete_connections_by_id
99107
*
100108
* @param connectionId the connection id.
101109
* @return a Request to execute.
@@ -118,6 +126,7 @@ public Request delete(String connectionId) {
118126

119127
/**
120128
* Update an existing Connection. A token with scope update:connections is needed. Note that if the 'options' value is present it will override all the 'options' values that currently exist.
129+
* See https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id
121130
*
122131
* @param connectionId the connection id.
123132
* @param connection the connection data to set. It can't include name or strategy.
@@ -144,6 +153,7 @@ public Request<Connection> update(String connectionId, Connection connection) {
144153

145154
/**
146155
* Delete an existing User from the given Database Connection. A token with scope delete:users is needed.
156+
* See https://auth0.com/docs/api/management/v2#!/Connections/delete_users_by_email
147157
*
148158
* @param connectionId the connection id where the user is stored.
149159
* @param email the email of the user to delete.

0 commit comments

Comments
 (0)