ibm-security-verify / verify-sdk-android

This repository is for active development of the IBM Security Verify SDK for Android.
MIT License
0 stars 4 forks source link

Unable to include IBM Security Verify SDK in project #7

Open sebi-ursulescu opened 5 months ago

sebi-ursulescu commented 5 months ago

Hello, there seems to be an issue with the Docs in this Repo because none of the methods described in them helped me to include the SDK in a project.

I've been trying to include the IBM Security Verify SDK in a POC for my Organization but I had no luck.

  1. The Main Readme file talks about: Jitpack and implementation 'com.github.ibm-security-verify:verify-sdk-android:<module>:<version>'

  2. The Authentication Readme says to include it like: implementation 'com.ibm.security.verifysdk.authentication:authentication:3.0.0'

I have also tried: implementation 'com.github.ibm-security-verify:authentication:3.0.0' implementation 'com.ibm.security.verifysdk:authentication:3.0.0'

  1. When you search this repo in Jitpack it finds it and tells you to include it like: implementation 'com.github.ibm-security-verify:verify-sdk-android:3.0.0-100'

  2. The Docs on the IBM Verify website are only for the Adaptive Android SDK

  3. There is another IBM Repo that I found online with samples for the IBM SDK but that one uses v2.1.9 which is older and doesn't have all the functionality of this SDK and also it requires you to download and include the .aar in your project.

What I'm trying to find out is how should I include the SDK in my project since all the documentation is misleading/conflicting/non-existent. If somebody could help me with this information it would be amazing.

Expected Behavior

Current Behavior

Possible Solution

chagemann commented 5 months ago

@sebi-ursulescu Thank you for reporting this. We are aware that the documentation is cluttered and we will fix that.

To answer your questions:

  1. There is another IBM Repo that I found online with samples for the IBM SDK but that one uses v2.1.9 which is older and doesn't have all the functionality of this SDK and also it requires you to download and include the .aar in your project.

That's correct - the first link is for v2 of the SDK. We open-sourced v3 of the SDK here https://github.com/ibm-security-verify/verify-sdk-android

What I'm trying to find out is how should I include the SDK in my project...

This is a mono-repo for multiple SDKs (core, authentication, fido2, mfa in dev) and uses Kotlin-DSL for build scripts. That seems to cause issues with the build on Jitpack, as others have reported as well. I will continue to investigate this. At the moment, the most reliable way to include specific SDKs into your project is described in the FIDO2 SDK. Those steps can be applied to other SDKs.

sebi-ursulescu commented 5 months ago

I managed to make it work by adding the .aar,.pom,sources.jar,javadoc.jar in a maven repository fashion inside the project

And specifying the maven repository in

settings.gradle.kts

@file:Suppress("UnstableApiUsage")

import java.net.URI

pluginManagement {
    repositories {
        mavenCentral()
        google()
        gradlePluginPortal()
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url = URI.create("file://${rootProject.projectDir}/repository")
        }
    }
}

rootProject.name = "A2 OIDC AZN demo"
include(":app")
include(":VerifySdk")

And in the :app module

build.gradle.kts

dependencies {
    implementation("com.ibm.security.verifysdk:authentication:3.0.1")
}

Thank you for your help! You can close the issue if you don't need it anymore 😄

chagemann commented 5 months ago

You can store the aar files in a folder, e.g. apps/libs and add that folder as a dependency in your apps build.gradle file:

dependencies {
    implementation fileTree(include: ['*.aar'], dir: 'libs')
   ...
}

That should solve the problem you described. The con of that approach is, that you won't be notified on new releases.

sebi-ursulescu commented 5 months ago

This approach was the first one I tried, but the Transitive dependencies are somehow not included in the aar so the library was crashing with NoClassDefFound exceptions and I tried adding some dependencies that it required to my project but it just kept crashing with other ones. This solution with .pom is great because it handles the Transitive dependencies.

chagemann commented 5 months ago

Thank you for publishing your solution.

I'm keeping this issue open, as a reminder to fix the underlying problem.