├── sample ├── .gitignore ├── consumer-rules.pro ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ ├── navigation │ │ │ └── nav_graph.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ ├── java │ │ └── com │ │ │ └── auth0 │ │ │ └── sample │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── auth0 ├── .gitignore ├── src │ ├── test │ │ ├── resources │ │ │ ├── empty_object.json │ │ │ ├── robolectric.properties │ │ │ ├── invalid.json │ │ │ ├── unknown.json │ │ │ ├── profile_oauth.json │ │ │ ├── org │ │ │ │ └── powermock │ │ │ │ │ └── extensions │ │ │ │ │ └── configuration.properties │ │ │ ├── credentials_legacy.json │ │ │ ├── identity_auth0.json │ │ │ ├── credentials_legacy_expires_at.json │ │ │ ├── credentials_openid.json │ │ │ ├── profile_basic.json │ │ │ ├── rsa_public.pem │ │ │ ├── rsa_jwks.json │ │ │ ├── credentials_openid_refresh_token.json │ │ │ ├── profile.json │ │ │ ├── identity_facebook.json │ │ │ ├── password_strength_error.json │ │ │ ├── rsa_private.pem │ │ │ └── profile_full.json │ │ ├── java │ │ │ ├── org │ │ │ │ └── mockito │ │ │ │ │ └── configuration │ │ │ │ │ └── MockitoConfiguration.java │ │ │ └── com │ │ │ │ └── auth0 │ │ │ │ └── android │ │ │ │ ├── provider │ │ │ │ ├── AlgorithmHelperMock.java │ │ │ │ ├── AuthenticationActivityMock.kt │ │ │ │ ├── FlagCheckerTest.java │ │ │ │ ├── RedirectActivityShadow.java │ │ │ │ ├── OAuthManagerTest.java │ │ │ │ ├── LogoutManagerTest.java │ │ │ │ ├── AuthorizeResultTest.java │ │ │ │ └── RedirectActivityTest.java │ │ │ │ ├── authentication │ │ │ │ ├── storage │ │ │ │ │ ├── ClockImplTest.java │ │ │ │ │ └── JWTDecoderTest.java │ │ │ │ └── request │ │ │ │ │ ├── RequestMock.java │ │ │ │ │ └── AuthenticationRequestMock.java │ │ │ │ ├── util │ │ │ │ ├── AttributeMatcher.java │ │ │ │ ├── TypeTokenMatcher.java │ │ │ │ ├── MockCallback.java │ │ │ │ ├── APIMockServer.kt │ │ │ │ ├── MockManagementCallback.java │ │ │ │ ├── MockAuthenticationCallback.java │ │ │ │ ├── CommonThreadSwitcherRule.kt │ │ │ │ ├── MockAuthCallback.java │ │ │ │ ├── SSLTestUtils.kt │ │ │ │ ├── UserIdentityMatcher.java │ │ │ │ ├── UserProfileMatcher.java │ │ │ │ ├── HttpUrlMatcher.java │ │ │ │ ├── AuthCallbackMatcher.java │ │ │ │ ├── CallbackMatcher.java │ │ │ │ ├── AuthenticationCallbackMatcher.java │ │ │ │ ├── ManagementCallbackMatcher.java │ │ │ │ └── UsersAPIMockServer.kt │ │ │ │ ├── result │ │ │ │ ├── DatabaseUserTest.java │ │ │ │ ├── CredentialsMock.kt │ │ │ │ ├── AuthenticationTest.java │ │ │ │ ├── UserIdentityTest.java │ │ │ │ └── UserProfileTest.java │ │ │ │ ├── management │ │ │ │ └── ManagementExceptionTest.kt │ │ │ │ └── request │ │ │ │ ├── internal │ │ │ │ ├── CredentialsDeserializerMock.kt │ │ │ │ ├── GsonBaseTest.kt │ │ │ │ ├── ThreadSwitcherShadow.java │ │ │ │ ├── JsonRequiredTypeAdapterFactoryTest.java │ │ │ │ ├── CredentialsDeserializerTest.kt │ │ │ │ ├── UserIdentityGsonTest.kt │ │ │ │ └── OptionalCredentialsGsonTest.kt │ │ │ │ └── ServerResponseTest.kt │ │ └── AndroidManifest.xml │ └── main │ │ ├── java │ │ └── com │ │ │ └── auth0 │ │ │ └── android │ │ │ ├── callback │ │ │ ├── RunnableTask.kt │ │ │ ├── ManagementCallback.kt │ │ │ ├── AuthenticationCallback.kt │ │ │ ├── BaseCallback.kt │ │ │ └── Callback.kt │ │ │ ├── request │ │ │ ├── internal │ │ │ │ ├── JsonRequired.kt │ │ │ │ ├── ResponseUtils.java │ │ │ │ ├── GsonProvider.kt │ │ │ │ ├── OidcUtils.kt │ │ │ │ ├── JsonRequiredTypeAdapterFactory.java │ │ │ │ ├── GsonAdapter.kt │ │ │ │ ├── TLS12SocketFactory.java │ │ │ │ ├── CredentialsDeserializer.kt │ │ │ │ ├── UserProfileDeserializer.java │ │ │ │ ├── RequestFactory.kt │ │ │ │ ├── Jwt.kt │ │ │ │ └── JwksDeserializer.kt │ │ │ ├── RequestOptions.kt │ │ │ ├── HttpMethod.kt │ │ │ ├── JsonAdapter.kt │ │ │ ├── NetworkingClient.kt │ │ │ ├── ServerResponse.kt │ │ │ ├── ErrorAdapter.kt │ │ │ ├── Request.kt │ │ │ └── AuthenticationRequest.kt │ │ │ ├── NetworkErrorException.kt │ │ │ ├── authentication │ │ │ ├── storage │ │ │ │ ├── CryptoException.kt │ │ │ │ ├── JWTDecoder.java │ │ │ │ ├── IncompatibleDeviceException.kt │ │ │ │ ├── ClockImpl.java │ │ │ │ ├── CredentialsManagerException.kt │ │ │ │ ├── Storage.kt │ │ │ │ └── SharedPreferencesStorage.kt │ │ │ └── PasswordlessType.java │ │ │ ├── result │ │ │ ├── Authentication.kt │ │ │ ├── DatabaseUser.kt │ │ │ ├── Challenge.kt │ │ │ ├── OptionalCredentials.kt │ │ │ ├── UserIdentity.kt │ │ │ ├── UserProfile.kt │ │ │ └── Credentials.kt │ │ │ ├── provider │ │ │ ├── IdTokenVerificationOptions.kt │ │ │ ├── FlagChecker.java │ │ │ ├── AuthHandler.kt │ │ │ ├── RedirectActivity.kt │ │ │ ├── ResumableManager.java │ │ │ ├── AuthCallback.kt │ │ │ ├── AlgorithmHelper.java │ │ │ ├── AsymmetricSignatureVerifier.java │ │ │ ├── CallbackHelper.java │ │ │ ├── AuthorizeResult.java │ │ │ ├── LogoutManager.kt │ │ │ └── SignatureVerifier.java │ │ │ ├── util │ │ │ ├── Clock.kt │ │ │ └── Auth0UserAgent.kt │ │ │ ├── Auth0Exception.kt │ │ │ ├── annotation │ │ │ └── ExperimentalAuth0Api.java │ │ │ └── management │ │ │ └── ManagementException.kt │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ └── AndroidManifest.xml └── proguard-rules.pro ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── Feature Request.yml │ └── Bug Report.yml ├── workflows │ ├── gradle-wrapper-validation.yml │ └── semgrep.yml ├── stale.yml └── PULL_REQUEST_TEMPLATE.md ├── .editorconfig ├── settings.gradle ├── opslevel.yml ├── .shiprc ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── proguard ├── proguard-okio.pro └── proguard-gson.pro ├── .gitattributes ├── codecov.yml ├── .circleci └── config.yml ├── LICENSE ├── gradle.properties ├── .gitignore └── gradlew.bat /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /auth0/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @auth0/dx-sdks-engineer 2 | -------------------------------------------------------------------------------- /auth0/src/test/resources/empty_object.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /auth0/src/test/resources/robolectric.properties: -------------------------------------------------------------------------------- 1 | sdk=29 -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf -------------------------------------------------------------------------------- /auth0/src/test/resources/invalid.json: -------------------------------------------------------------------------------- 1 | "AN INVALID JSON" -------------------------------------------------------------------------------- /auth0/src/test/resources/unknown.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "value", 3 | "flag": false 4 | } -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Auth0.Android' 2 | include 'auth0' 3 | include ':sample' -------------------------------------------------------------------------------- /opslevel.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 1 3 | repository: 4 | owner: dx_sdks 5 | tier: 6 | tags: 7 | -------------------------------------------------------------------------------- /auth0/src/test/resources/profile_oauth.json: -------------------------------------------------------------------------------- 1 | { 2 | "sub": "google-oauth2|9883254263433883220" 3 | } -------------------------------------------------------------------------------- /auth0/src/test/resources/org/powermock/extensions/configuration.properties: -------------------------------------------------------------------------------- 1 | mockito.mock-maker-class=mock-maker-inline -------------------------------------------------------------------------------- /.shiprc: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "auth0/build.gradle": [], 4 | "README.md": [] 5 | }, 6 | "prefixVersion": false 7 | } 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnfrench3/Android-Auth-Progurd/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /auth0/src/test/resources/credentials_legacy.json: -------------------------------------------------------------------------------- 1 | { 2 | "access_token": "s6GS5FGJN2jfd4l6", 3 | "token_type": "bearer", 4 | "expires_in": 86000 5 | } -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/callback/RunnableTask.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.callback 2 | 3 | internal interface RunnableTask { 4 | fun apply(t: T) 5 | } -------------------------------------------------------------------------------- /auth0/src/test/resources/identity_auth0.json: -------------------------------------------------------------------------------- 1 | { 2 | "user_id": "1234567890", 3 | "provider": "auth0", 4 | "connection": "Username-Password-Authentication", 5 | "isSocial": false 6 | } -------------------------------------------------------------------------------- /proguard/proguard-okio.pro: -------------------------------------------------------------------------------- 1 | # Okio 2 | 3 | -dontwarn java.nio.file.* 4 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 5 | -dontwarn com.squareup.okhttp.internal.Platform 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Auth0 Community 4 | url: https://community.auth0.com 5 | about: Discuss this SDK in the Auth0 Community forums 6 | -------------------------------------------------------------------------------- /auth0/src/test/resources/credentials_legacy_expires_at.json: -------------------------------------------------------------------------------- 1 | { 2 | "access_token": "s6GS5FGJN2jfd4l6", 3 | "token_type": "bearer", 4 | "expires_in": 86000, 5 | "expires_at": "2009-02-15T07:49:06.555Z" 6 | } -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/callback/ManagementCallback.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.callback 2 | 3 | import com.auth0.android.management.ManagementException 4 | 5 | public interface ManagementCallback : Callback -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/request/internal/JsonRequired.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.request.internal 2 | 3 | @kotlin.annotation.Retention(AnnotationRetention.RUNTIME) 4 | @Target(AnnotationTarget.FIELD) 5 | internal annotation class JsonRequired -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/callback/AuthenticationCallback.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.callback 2 | 3 | import com.auth0.android.authentication.AuthenticationException 4 | 5 | public interface AuthenticationCallback : Callback -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/NetworkErrorException.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android 2 | 3 | /** 4 | * Exception that represents a failure caused when attempting to execute a network request 5 | */ 6 | public class NetworkErrorException(cause: Throwable) : 7 | Auth0Exception("Failed to execute the network request", cause) -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Auth0 SDK Sample 3 | poovamraj.eu.auth0.com 4 | swarLtLAd0aW55ajPUPzYPXjtB3UtZki 5 | demo 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # We'll let Git's auto-detection algorithm infer if a file is text. If it is, 2 | # enforce LF line endings regardless of OS or git configurations. 3 | * text=auto eol=lf 4 | 5 | # Isolate binary files in case the auto-detection algorithm fails and 6 | # marks them as text files (which could brick them). 7 | *.{png,jpg,jpeg,gif,webp,woff,woff2} binary -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/authentication/storage/CryptoException.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.authentication.storage 2 | 3 | /** 4 | * Exception thrown by the [CryptoUtil] class whenever an operation goes wrong. 5 | */ 6 | public open class CryptoException internal constructor(message: String, cause: Throwable? = null) : 7 | RuntimeException(message, cause) -------------------------------------------------------------------------------- /.github/workflows/gradle-wrapper-validation.yml: -------------------------------------------------------------------------------- 1 | name: "Validate Gradle Wrapper" 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | validation: 6 | name: "validation/gradlew" 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - uses: gradle/wrapper-validation-action@8d49e559aae34d3e0eb16cde532684bc9702762b # pin@1.0.6 11 | -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/request/RequestOptions.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.request 2 | 3 | /** 4 | * Holder for the information required to configure a request 5 | */ 6 | public class RequestOptions(public val method: HttpMethod) { 7 | public val parameters: MutableMap = mutableMapOf() 8 | public val headers: MutableMap = mutableMapOf() 9 | } -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/result/Authentication.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.result 2 | 3 | /** 4 | * The result of a successful authentication against Auth0 5 | * Contains the logged in user's [Credentials] and [UserProfile]. 6 | * 7 | * @see [com.auth0.android.authentication.AuthenticationAPIClient.getProfileAfter] 8 | */ 9 | public class Authentication(public val profile: UserProfile, public val credentials: Credentials) -------------------------------------------------------------------------------- /auth0/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Missing permissions 3 | Some permissions required by this provider were not granted. You can try to authenticate again or go to the application\'s permission screen in the phone settings and grant them. The missing permissions are:\n%s 4 | 5 | -------------------------------------------------------------------------------- /auth0/src/test/resources/credentials_openid.json: -------------------------------------------------------------------------------- 1 | { 2 | "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NhbXBsZXMuYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDUzYjk5NWY4YmNlNjhkOWZjOTAwMDk5YyIsImF1ZCI6Ikk5bWhVcmZrVEdGVldqbEVxWlNUQ0JVRkFCTGJKRkdMMyIsImV4cCI6MTQ2NTEwOTAzMywiaWF0IjoxNDY1MDczMDMzfQ.TdRc-lnVcX0LT7ZySzVysjVcYzAUIRnCPufTO8VV6g8", 3 | "access_token": "s6GS5FGJN2jfd4l6", 4 | "token_type": "bearer", 5 | "expires_in": 86000 6 | } -------------------------------------------------------------------------------- /sample/src/main/java/com/auth0/sample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.sample 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | 6 | class MainActivity : AppCompatActivity() { 7 | 8 | override fun onCreate(savedInstanceState: Bundle?) { 9 | super.onCreate(savedInstanceState) 10 | setContentView(R.layout.activity_main) 11 | setSupportActionBar(findViewById(R.id.toolbar)) 12 | } 13 | } -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/authentication/storage/JWTDecoder.java: -------------------------------------------------------------------------------- 1 | package com.auth0.android.authentication.storage; 2 | 3 | import com.auth0.android.request.internal.Jwt; 4 | 5 | /** 6 | * Bridge class for decoding JWTs. 7 | * Used to abstract the implementation for testing purposes. 8 | */ 9 | class JWTDecoder { 10 | 11 | JWTDecoder() { 12 | } 13 | 14 | Jwt decode(String jwt) { 15 | return new Jwt(jwt); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/authentication/storage/IncompatibleDeviceException.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.authentication.storage 2 | 3 | /** 4 | * Exception thrown by the [CryptoUtil] class whenever the Keys are deemed invalid 5 | * and so the content encrypted with them unrecoverable. 6 | */ 7 | internal class IncompatibleDeviceException(cause: Throwable?) : CryptoException( 8 | "The device is not compatible with the ${CryptoUtil::class.java.simpleName} class.", cause 9 | ) -------------------------------------------------------------------------------- /auth0/src/main/java/com/auth0/android/callback/BaseCallback.kt: -------------------------------------------------------------------------------- 1 | package com.auth0.android.callback 2 | 3 | import com.auth0.android.Auth0Exception 4 | 5 | /** 6 | * Legacy interface to handle successful callbacks. Use {@linkplain Callback} instead. 7 | */ 8 | @Deprecated( 9 | message = "The contract of this interface has been migrated to the Callback interface", 10 | replaceWith = ReplaceWith("Callback") 11 | ) 12 | public interface BaseCallback : Callback -------------------------------------------------------------------------------- /auth0/src/test/resources/profile_basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "picture": "https://secure.gravatar.com/avatar/cfacbe113a96fdfc85134534771d88b4?s=480&r=pg&d=https%3A%2F%2Fssl.gstatic.com%2Fs2%2Fprofiles%2Fimages%2Fsilhouette80.png", 3 | "name": "info @ auth0", 4 | "nickname": "a0", 5 | "user_id": "auth0|1234567890", 6 | "identities": [ 7 | { 8 | "user_id": "1234567890", 9 | "provider": "auth0", 10 | "connection": "Username-Password-Authentication" 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /sample/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 |