@@ -72,7 +72,9 @@ public void doNotSendTelemetry() {
7272 }
7373
7474 /**
75- * Whether to enable or not the current Http Logger for every Request, Response and other sensitive information.
75+ * Whether to enable or not the current HTTP Logger for every Request, Response and other sensitive information.
76+ *
77+ * @param enabled whether to enable the HTTP logger or not.
7678 */
7779 public void setLoggingEnabled (boolean enabled ) {
7880 logging .setLevel (enabled ? Level .BODY : Level .NONE );
@@ -100,15 +102,16 @@ private String createBaseUrl(String domain) {
100102 /**
101103 * Creates a new instance of the {@link AuthorizeUrlBuilder} with the given redirect url.
102104 * i.e.:
103- * <p>
104105 * <pre>
105- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
106- * String url = auth.authorizeUrl("https://me.auth0.com/callback")
107- * .withConnection("facebook")
108- * .withAudience("https://api.me.auth0.com/users")
109- * .withScope("openid contacts")
110- * .withState("my-custom-state")
111- * .build();
106+ * {@code
107+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
108+ * String url = auth.authorizeUrl("https://me.auth0.com/callback")
109+ * .withConnection("facebook")
110+ * .withAudience("https://api.me.auth0.com/users")
111+ * .withScope("openid contacts")
112+ * .withState("my-custom-state")
113+ * .build();
114+ * }
112115 * </pre>
113116 *
114117 * @param redirectUri the redirect_uri value to set, white-listed in the client settings. Must be already URL Encoded.
@@ -123,12 +126,13 @@ public AuthorizeUrlBuilder authorizeUrl(String redirectUri) {
123126 /**
124127 * Creates a new instance of the {@link LogoutUrlBuilder} with the given return-to url.
125128 * i.e.:
126- * <p>
127129 * <pre>
128- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
129- * String url = auth.logoutUrl("https://me.auth0.com/home", true)
130- * .useFederated(true)
131- * .withAccessToken("A9CvPwFojaBIA9CvI");
130+ * {@code
131+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
132+ * String url = auth.logoutUrl("https://me.auth0.com/home", true)
133+ * .useFederated(true)
134+ * .withAccessToken("A9CvPwFojaBIA9CvI");
135+ * }
132136 * </pre>
133137 *
134138 * @param returnToUrl the redirect_uri value to set, white-listed in the client settings. Must be already URL Encoded.
@@ -145,14 +149,15 @@ public LogoutUrlBuilder logoutUrl(String returnToUrl, boolean setClientId) {
145149 /**
146150 * Request the user information related to the access token.
147151 * i.e.:
148- * <p>
149152 * <pre>
150- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
151- * try {
152- * UserInfo result = auth.userInfo("A9CvPwFojaBIA9CvI").execute();
153- * } catch (Auth0Exception e) {
154- * //Something happened
155- * }
153+ * {@code
154+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
155+ * try {
156+ * UserInfo result = auth.userInfo("A9CvPwFojaBIA9CvI").execute();
157+ * } catch (Auth0Exception e) {
158+ * //Something happened
159+ * }
160+ * }
156161 * </pre>
157162 *
158163 * @param accessToken a valid access token belonging to an API signed with RS256 algorithm and containing the scope 'openid'.
@@ -176,14 +181,15 @@ public Request<UserInfo> userInfo(String accessToken) {
176181 * Request a password reset for the given email and database connection. The response will always be successful even if
177182 * there's no user associated to the given email for that database connection.
178183 * i.e.:
179- * <p>
180184 * <pre>
181- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
182- * try {
183- * auth.resetPassword("me@auth0.com", "db-connection").execute();
184- * } catch (Auth0Exception e) {
185- * //Something happened
186- * }
185+ * {@code
186+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
187+ * try {
188+ * auth.resetPassword("me@auth0.com", "db-connection").execute();
189+ * } catch (Auth0Exception e) {
190+ * //Something happened
191+ * }
192+ * }
187193 * </pre>
188194 *
189195 * @param email the email associated to the database user.
@@ -211,19 +217,20 @@ public Request resetPassword(String email, String connection) {
211217 * Creates a new sign up request with the given credentials and database connection.
212218 * "Requires Username" option must be turned on in the Connection's configuration first.
213219 * i.e.:
214- * <p>
215220 * <pre>
216- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
217- * try {
218- * Map<String, String> fields = new HashMap<String, String>();
219- * fields.put("age", "25);
220- * fields.put("city", "Buenos Aires");
221- * auth.signUp("me@auth0.com", "myself", "topsecret", "db-connection")
222- * .setCustomFields(fields)
223- * .execute();
224- * } catch (Auth0Exception e) {
225- * //Something happened
226- * }
221+ * {@code
222+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
223+ * try {
224+ * Map<String, String> fields = new HashMap<String, String>();
225+ * fields.put("age", "25);
226+ * fields.put("city", "Buenos Aires");
227+ * auth.signUp("me@auth0.com", "myself", "topsecret", "db-connection")
228+ * .setCustomFields(fields)
229+ * .execute();
230+ * } catch (Auth0Exception e) {
231+ * //Something happened
232+ * }
233+ * }
227234 * </pre>
228235 *
229236 * @param email the desired user's email.
@@ -243,19 +250,20 @@ public SignUpRequest signUp(String email, String username, String password, Stri
243250 /**
244251 * Creates a new sign up request with the given credentials and database connection.
245252 * i.e.:
246- * <p>
247253 * <pre>
248- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
249- * try {
250- * Map<String, String> fields = new HashMap<String, String>();
251- * fields.put("age", "25);
252- * fields.put("city", "Buenos Aires");
253- * auth.signUp("me@auth0.com", "topsecret", "db-connection")
254- * .setCustomFields(fields)
255- * .execute();
256- * } catch (Auth0Exception e) {
257- * //Something happened
258- * }
254+ * {@code
255+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
256+ * try {
257+ * Map<String, String> fields = new HashMap<String, String>();
258+ * fields.put("age", "25);
259+ * fields.put("city", "Buenos Aires");
260+ * auth.signUp("me@auth0.com", "topsecret", "db-connection")
261+ * .setCustomFields(fields)
262+ * .execute();
263+ * } catch (Auth0Exception e) {
264+ * //Something happened
265+ * }
266+ * }
259267 * </pre>
260268 *
261269 * @param email the desired user's email.
@@ -285,16 +293,17 @@ public SignUpRequest signUp(String email, String password, String connection) {
285293 /**
286294 * Creates a new log in request using the 'Password' grant and the given credentials.
287295 * i.e.:
288- * <p>
289296 * <pre>
290- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
291- * try {
292- * TokenHolder result = auth.login("me@auth0.com", "topsecret")
293- * .setScope("openid email nickname")
294- * .execute();
295- * } catch (Auth0Exception e) {
296- * //Something happened
297- * }
297+ * {@code
298+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
299+ * try {
300+ * TokenHolder result = auth.login("me@auth0.com", "topsecret")
301+ * .setScope("openid email nickname")
302+ * .execute();
303+ * } catch (Auth0Exception e) {
304+ * //Something happened
305+ * }
306+ * }
298307 * </pre>
299308 *
300309 * @param emailOrUsername the identity of the user.
@@ -323,20 +332,22 @@ public AuthRequest login(String emailOrUsername, String password) {
323332 /**
324333 * Creates a new log in request using the 'Password Realm' grant and the given credentials.
325334 * Default used realm and audience are defined in the "API Authorization Settings" in the account's advanced settings in the Auth0 Dashboard.
326- * <p>
327335 * <pre>
328- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
329- * try {
330- * TokenHolder result = auth.login("me@auth0.com", "topsecret", "my-realm")
331- * .setAudience("https://myapi.me.auth0.com/users")
332- * .execute();
333- * } catch (Auth0Exception e) {
334- * //Something happened
335- * }
336+ * {@code
337+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
338+ * try {
339+ * TokenHolder result = auth.login("me@auth0.com", "topsecret", "my-realm")
340+ * .setAudience("https://myapi.me.auth0.com/users")
341+ * .execute();
342+ * } catch (Auth0Exception e) {
343+ * //Something happened
344+ * }
345+ * }
336346 * </pre>
337347 *
338348 * @param emailOrUsername the identity of the user.
339349 * @param password the password of the user.
350+ * @param realm the realm to use.
340351 * @return a Request to configure and execute.
341352 */
342353 public AuthRequest login (String emailOrUsername , String password , String realm ) {
@@ -363,16 +374,17 @@ public AuthRequest login(String emailOrUsername, String password, String realm)
363374 /**
364375 * Creates a new request to get a Token for the given audience using the 'Client Credentials' grant.
365376 * Default used realm is defined in the "API Authorization Settings" in the account's advanced settings in the Auth0 Dashboard.
366- * <p>
367377 * <pre>
368- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
369- * try {
370- * TokenHolder result = auth.requestToken("https://myapi.me.auth0.com/users")
371- * .setRealm("my-realm")
372- * .execute();
373- * } catch (Auth0Exception e) {
374- * //Something happened
375- * }
378+ * {@code
379+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
380+ * try {
381+ * TokenHolder result = auth.requestToken("https://myapi.me.auth0.com/users")
382+ * .setRealm("my-realm")
383+ * .execute();
384+ * } catch (Auth0Exception e) {
385+ * //Something happened
386+ * }
387+ * }
376388 * </pre>
377389 *
378390 * @param audience the audience of the API to request access to.
@@ -397,16 +409,17 @@ public AuthRequest requestToken(String audience) {
397409
398410 /**
399411 * Creates a new request to exchange the code obtained in the /authorize call using the 'Authorization Code' grant.
400- * <p>
401412 * <pre>
402- * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
403- * try {
404- * TokenHolder result = auth.exchangeCode("SnWoFLMzApDskr", "https://me.auth0.com/callback")
405- * .setScope("openid name nickname")
406- * .execute();
407- * } catch (Auth0Exception e) {
408- * //Something happened
409- * }
413+ * {@code
414+ * AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
415+ * try {
416+ * TokenHolder result = auth.exchangeCode("SnWoFLMzApDskr", "https://me.auth0.com/callback")
417+ * .setScope("openid name nickname")
418+ * .execute();
419+ * } catch (Auth0Exception e) {
420+ * //Something happened
421+ * }
422+ * }
410423 * </pre>
411424 *
412425 * @param code the authorization code received from the /authorize call.
0 commit comments