diff --git a/auth0/src/main/java/com/auth0/android/Auth0.java b/auth0/src/main/java/com/auth0/android/Auth0.java index 3604ca9fb..934018428 100755 --- a/auth0/src/main/java/com/auth0/android/Auth0.java +++ b/auth0/src/main/java/com/auth0/android/Auth0.java @@ -35,7 +35,7 @@ import com.squareup.okhttp.HttpUrl; /** - * Represents your Auth0 account information (clientId & domain), + * Represents your Auth0 account information (clientId {@literal &} domain), * and it's used to obtain clients for Auth0's APIs. *
{@code * Auth0 auth0 = new Auth0("YOUR_CLIENT_ID", "YOUR_DOMAIN"); @@ -65,7 +65,7 @@ public Auth0(@NonNull Context context) { } /** - * Creates a new object using clientId & domain + * Creates a new object using clientId {@literal &} domain * * @param clientId of your Auth0 application * @param domain of your Auth0 account @@ -167,13 +167,17 @@ public void setOIDCConformant(boolean enabled) { /** * If the clients works in OIDC conformant mode or not + * + * @return whether the android client is OIDC conformant or not. */ public boolean isOIDCConformant() { return oidcConformant; } /** - * @return if every Request, Response and other sensitive information should be logged. + * Getter for the HTTP logger is enabled or not. + * + * @return whether every Request, Response and other sensitive information should be logged or not. */ public boolean isLoggingEnabled() { return loggingEnabled; diff --git a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java index fa6306716..a79b57524 100755 --- a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java +++ b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java @@ -61,11 +61,12 @@ /** * API client for Auth0 Authentication API. - * - ** * @see Auth API docs */ @@ -159,12 +160,11 @@ public void setUserAgent(String userAgent) { /** * Log in a user with email/username and password for a connection/realm. - *+ * } + *+ *
+ * {@code * Auth0 auth0 = new Auth0("your_client_id", "your_domain"); * AuthenticationAPIClient client = new AuthenticationAPIClient(auth0); - *
* In OIDC conformant mode ({@link Auth0#isOIDCConformant()}) it will use the password-realm grant type for the {@code /oauth/token} endpoint * otherwise it will use {@code /oauth/ro} - *
* Example: - *
+ *
+ * {@code
* client
* .login("{username or email}", "{password}", "{database connection name}")
* .start(new BaseCallback() {
@@ -174,7 +174,8 @@ public void setUserAgent(String userAgent) {
* {@literal}Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param usernameOrEmail of the user depending of the type of DB connection
* @param password of the user
@@ -207,7 +208,8 @@ public AuthenticationRequest login(@NonNull String usernameOrEmail, @NonNull Str
/**
* Log in a user with email/username and password using the password grant and the default directory
* Example usage:
- *
+ *
+ * {@code
* client.login("{username or email}", "{password}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -216,7 +218,8 @@ public AuthenticationRequest login(@NonNull String usernameOrEmail, @NonNull Str
* {@literal}Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param usernameOrEmail of the user
* @param password of the user
@@ -234,10 +237,11 @@ public AuthenticationRequest login(@NonNull String usernameOrEmail, @NonNull Str
}
/**
- * Log in a user with a OAuth 'access_token' of a Identity Provider like Facebook or Twitter using '\oauth\access_token' endpoint
+ * Log in a user with a OAuth 'access_token' of a Identity Provider like Facebook or Twitter using '\oauth\access_token' endpoint
* The default scope used is 'openid'.
* Example usage:
- *
+ *
+ * {@code
* client.loginWithOAuthAccessToken("{token}", "{connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -246,7 +250,8 @@ public AuthenticationRequest login(@NonNull String usernameOrEmail, @NonNull Str
* {@literal}Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param token obtained from the IdP
* @param connection that will be used to authenticate the user, e.g. 'facebook'
@@ -273,7 +278,8 @@ public AuthenticationRequest loginWithOAuthAccessToken(@NonNull String token, @N
* Log in a user using a phone number and a verification code received via SMS (Part of passwordless login flow)
* The default scope used is 'openid'.
* Example usage:
- *
+ *
+ * {@code
* client.loginWithPhoneNumber("{phone number}", "{code}", "{passwordless connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -282,7 +288,8 @@ public AuthenticationRequest loginWithOAuthAccessToken(@NonNull String token, @N
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param phoneNumber where the user received the verification code
* @param verificationCode sent by Auth0 via SMS
@@ -305,7 +312,8 @@ public AuthenticationRequest loginWithPhoneNumber(@NonNull String phoneNumber, @
* Log in a user using a phone number and a verification code received via SMS (Part of passwordless login flow).
* By default it will try to authenticate using the "sms" connection.
* Example usage:
- *
+ *
+ * {@code
* client.loginWithPhoneNumber("{phone number}", "{code}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -314,7 +322,8 @@ public AuthenticationRequest loginWithPhoneNumber(@NonNull String phoneNumber, @
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param phoneNumber where the user received the verification code
* @param verificationCode sent by Auth0 via SMS
@@ -329,7 +338,8 @@ public AuthenticationRequest loginWithPhoneNumber(@NonNull String phoneNumber, @
* Log in a user using an email and a verification code received via Email (Part of passwordless login flow).
* The default scope used is 'openid'.
* Example usage:
- *
+ *
+ * {@code
* client.loginWithEmail("{email}", "{code}", "{passwordless connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -338,7 +348,8 @@ public AuthenticationRequest loginWithPhoneNumber(@NonNull String phoneNumber, @
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param email where the user received the verification code
* @param verificationCode sent by Auth0 via Email
@@ -361,7 +372,8 @@ public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull Stri
* Log in a user using an email and a verification code received via Email (Part of passwordless login flow)
* By default it will try to authenticate using the "email" connection.
* Example usage:
- *
+ *
+ * {@code
* client.loginWithEmail("{email}", "{code}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -370,7 +382,8 @@ public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull Stri
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param email where the user received the verification code
* @param verificationCode sent by Auth0 via Email
@@ -384,7 +397,8 @@ public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull Stri
/**
* Returns the information of the user associated with the given access_token.
* Example usage:
- *
+ *
+ * {@code
* client.userInfo("{access_token}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -393,7 +407,8 @@ public AuthenticationRequest loginWithEmail(@NonNull String email, @NonNull Stri
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param accessToken used to fetch it's information
* @return a request to start
@@ -406,9 +421,9 @@ public Request* Example usage: - *
+ *
+ * {@code
* client.tokenInfo("{id_token}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -417,7 +432,8 @@ public Request userInfo(@NonNull String ac
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param idToken used to fetch it's information
* @return a request to start
@@ -435,9 +451,10 @@ public Request
+ *
+ * {@code
* client.createUser("{email}", "{password}", "{username}", "{database connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -446,7 +463,8 @@ public Request tokenInfo(@NonNull String i
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param email of the user and must be non null
* @param password of the user and must be non null
@@ -475,9 +493,10 @@ public DatabaseConnectionRequest
+ *
+ * {@code
* client.createUser("{email}", "{password}", "{database connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -486,7 +505,8 @@ public DatabaseConnectionRequest createUs
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param email of the user and must be non null
* @param password of the user and must be non null
@@ -500,10 +520,11 @@ public DatabaseConnectionRequest
+ *
+ * {@code
* client.signUp("{email}", "{password}", "{username}", "{database connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -512,7 +533,8 @@ public DatabaseConnectionRequest createUs
* {@literal}Override
* public void onFailure(AuthenticationException error) {}
* });
- *
+ * }
+ *
*
* @param email of the user and must be non null
* @param password of the user and must be non null
@@ -529,10 +551,11 @@ public SignUpRequest signUp(@NonNull String email, @NonNull String password, @No
}
/**
- * Creates a user in a DB connection using '/dbconnections/signup' endpoint
+ * Creates a user in a DB connection using '/dbconnections/signup' endpoint
* and then logs in the user. How the user is logged in depends on the {@link Auth0#isOIDCConformant()} flag.
* Example usage:
- *
+ *
+ * {@code
* client.signUp("{email}", "{password}", "{database connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -541,7 +564,8 @@ public SignUpRequest signUp(@NonNull String email, @NonNull String password, @No
* {@literal}Override
* public void onFailure(AuthenticationException error) {}
* });
- *
+ * }
+ *
*
* @param email of the user and must be non null
* @param password of the user and must be non null
@@ -556,9 +580,10 @@ public SignUpRequest signUp(@NonNull String email, @NonNull String password, @No
}
/**
- * Request a reset password using '/dbconnections/change_password'
+ * Request a reset password using '/dbconnections/change_password'
* Example usage:
- *
+ *
+ * {@code
* client.resetPassword("{email}", "{database connection name}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -567,7 +592,8 @@ public SignUpRequest signUp(@NonNull String email, @NonNull String password, @No
* {@literal}Override
* public void onFailure(AuthenticationException error) {}
* });
- *
+ * }
+ *
*
* @param email of the user to request the password reset. An email will be sent with the reset instructions.
* @param connection of the database to request the reset password on
@@ -595,9 +621,9 @@ public DatabaseConnectionRequest* Example usage: - *
+ *
+ * {@code
* client.renewAuth("{refresh_token}")
* .addParameter("scope", "openid profile email")
* .start(new BaseCallback() {
@@ -607,7 +633,8 @@ public DatabaseConnectionRequest resetPassword(@N
* {@literal}@Override
* public void onFailure(AuthenticationException error) { }
* });
- *
+ * }
+ *
*
* @param refreshToken used to fetch the new Credentials.
* @return a request to start
@@ -637,9 +664,10 @@ public ParameterizableRequest
+ *
+ * {@code
* client.delegationWithIdToken("{id token}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -648,7 +676,8 @@ public ParameterizableRequest renewAuth(@N
* {@literal}Override
* public void onFailure(AuthenticationException error) {}
* });
- *
+ * }
+ *
*
* @param idToken issued by Auth0 for the user. The token must not be expired.
* @return a request to configure and start
@@ -663,10 +692,11 @@ public DelegationRequest
+ *
+ * {@code
* client.delegationWithRefreshToken("{refresh token}")
* .start(new BaseCallback() {
* {@literal}Override
@@ -675,7 +705,8 @@ public DelegationRequest delegationWithIdToken(@NonNull String idTok
* {@literal}Override
* public void onFailure(AuthenticationException error) {}
* });
- *
+ * }
+ *
*
* @param refreshToken issued by Auth0 for the user when using the 'offline_access' scope when logging in.
* @return a request to configure and start
@@ -690,9 +721,10 @@ public DelegationRequest
+ *
+ * {@code
* client.delegationWithIdToken("{id token}", "{app type, e.g. firebase}")
* .start(new BaseCallback
+ * }
+ *
*
* @param idToken issued by Auth0 for the user. The token must not be expired.
* @param apiType the delegation 'api_type' parameter
@@ -717,9 +750,10 @@ public DelegationRequest