(){
+ public void onSuccess(Credentials credentials){
+ //Use the Credentials
+ }
+
+ public void onFailure(CredentialsManagerException error){
+ //Error!
+ }
+});
```
-> The default scope used is `openid`
-
-#### Specify Connection scope
-
-```java
-WebAuthProvider.init(account)
- .withConnectionScope("email", "profile", "calendar:read")
- .start(MainActivity.this, authCallback);
-```
-#### Authenticate with Auth0 hosted login page
-Simply don't specify any custom connection and the Lock web widget will show.
+5. **Clear credentials**
+When you want to log the user out:
```java
-WebAuthProvider.init(account)
- .start(MainActivity.this, authCallback);
+manager.clearCredentials();
```
-
## FAQ
* Why is the Android Lint _error_ `'InvalidPackage'` considered a _warning_?
@@ -396,7 +515,7 @@ android {
ref: https://github.com/square/okio/issues/58#issuecomment-72672263
-##Proguard
+## Proguard
The rules should be applied automatically if your application is using `minifyEnabled = true`. If you want to include them manually check the [proguard directory](proguard).
By default you should at least use the following files:
* `proguard-okio.pro`
diff --git a/auth0/build.gradle b/auth0/build.gradle
index 152195589..6ee655754 100644
--- a/auth0/build.gradle
+++ b/auth0/build.gradle
@@ -59,14 +59,21 @@ android {
lintOptions {
warning 'InvalidPackage'
}
+ buildTypes {
+ debug {
+ //Helps tests. buildTypes values are not included in the merged manifest
+ manifestPlaceholders = [auth0Domain: "auth0.test.domain"]
+ }
+ }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:25.0.1'
+ compile 'com.android.support:appcompat-v7:25.3.1'
+ compile 'com.android.support:customtabs:25.3.1'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
- compile 'com.google.code.gson:gson:2.6.2'
+ compile 'com.google.code.gson:gson:2.7'
compile 'com.auth0.android:jwtdecode:1.1.0'
testCompile 'junit:junit:4.12'
diff --git a/auth0/src/main/AndroidManifest.xml b/auth0/src/main/AndroidManifest.xml
index ccc5384fb..6f2354e4b 100644
--- a/auth0/src/main/AndroidManifest.xml
+++ b/auth0/src/main/AndroidManifest.xml
@@ -22,4 +22,35 @@
~ THE SOFTWARE.
-->
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/auth0/src/main/java/com/auth0/android/Auth0.java b/auth0/src/main/java/com/auth0/android/Auth0.java
index 934018428..d32932d2a 100755
--- a/auth0/src/main/java/com/auth0/android/Auth0.java
+++ b/auth0/src/main/java/com/auth0/android/Auth0.java
@@ -40,6 +40,15 @@
* {@code
* Auth0 auth0 = new Auth0("YOUR_CLIENT_ID", "YOUR_DOMAIN");
* }
+ * It is strongly encouraged that this SDK be used in OIDC Conformant mode.
+ * When this mode is enabled, it will force the SDK to use Auth0's current authentication pipeline
+ * and will prevent it from reaching legacy endpoints. By default is `false`
+ * {@code
+ * auth0.setOIDCConformant(true);
+ * }
+ * For more information, please see the OIDC adoption guide.
+ *
+ * @see Auth0#setOIDCConformant(boolean)
*/
public class Auth0 {
@@ -148,9 +157,11 @@ public void doNotSendTelemetry() {
}
/**
- * Defines if the client uses OIDC conformant authentication endpoints. By default is {@code false}
+ * It is strongly encouraged that this SDK be used in OIDC Conformant mode.
+ * When this mode is enabled, it will force the SDK to use Auth0's current authentication pipeline
+ * and will prevent it from reaching legacy endpoints. By default is {@code false}
+ * For more information, please see the OIDC adoption guide.
*
- * You will need to enable this setting in the Auth0 Dashboard first: Go to Account (top right), Account Settings, click Advanced and check the toggle at the bottom.
* This setting affects how authentication is performed in the following methods:
*
* - {@link AuthenticationAPIClient#login(String, String, String)}
@@ -159,7 +170,7 @@ public void doNotSendTelemetry() {
* - {@link AuthenticationAPIClient#renewAuth(String)}
*
*
- * @param enabled if Lock will use the Legacy Auth API or the new OIDC Conformant Auth API.
+ * @param enabled if Lock will use the Legacy Authentication API or the new OIDC Conformant Authentication API.
*/
public void setOIDCConformant(boolean enabled) {
this.oidcConformant = enabled;
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 024ee3c83..50cb8079e 100755
--- a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java
+++ b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java
@@ -163,7 +163,7 @@ public void setUserAgent(String userAgent) {
/**
* Log in a user with email/username and password for a connection/realm.
* 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}
+ * otherwise it will use {@code /oauth/ro}, which requires your client to have the Resource Owner Legacy Grant Type enabled. See Client Grant Types to learn how to enable it.
* Example:
*
* {@code
@@ -279,6 +279,7 @@ 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'.
+ * Requires your client to have the Resource Owner Legacy Grant Type enabled. See Client Grant Types to learn how to enable it.
* Example usage:
*
* {@code
@@ -339,6 +340,7 @@ 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'.
+ * Requires your client to have the Resource Owner Legacy Grant Type enabled. See Client Grant Types to learn how to enable it.
* Example usage:
*
* {@code
@@ -622,7 +624,6 @@ public DatabaseConnectionRequest resetPassword(@N
/**
* Request the revoke of a given refresh_token. Once revoked, the refresh_token cannot be used to obtain new tokens.
* The client must be of type 'Native' or have the 'Token Endpoint Authentication Method' set to 'none' for this endpoint to work.
- *
* Example usage:
*
* {@code
@@ -790,6 +791,7 @@ public DelegationRequest