AzureAD / microsoft-authentication-library-for-java

Microsoft Authentication Library (MSAL) for Java http://aka.ms/aadv2
MIT License
285 stars 141 forks source link

OSGi dependencies for MSAL4J bundle #231

Closed maciejmalycha closed 4 years ago

maciejmalycha commented 4 years ago

I'm trying to load com.microsoft.azure:msal4j:1.4.0 as OSGi bundle into Apache Karaf using its dependency tree:

com.microsoft.azure:msal4j:1.4.0
+--- com.nimbusds:oauth2-oidc-sdk:6.5
|    +--- com.sun.mail:javax.mail:1.6.1
|    |    \--- javax.activation:activation:1.1
|    +--- com.github.stephenc.jcip:jcip-annotations:1.0-1
|    +--- net.minidev:json-smart:[1.3.1,2.3] -> 2.3
|    |    \--- net.minidev:accessors-smart:1.2
|    |         \--- org.ow2.asm:asm:5.0.4
|    +--- com.nimbusds:lang-tag:[1.4.3,) -> 1.4.4
|    \--- com.nimbusds:nimbus-jose-jwt:[6.0.1,) -> 8.16
|         +--- com.github.stephenc.jcip:jcip-annotations:1.0-1
|         \--- net.minidev:json-smart:[1.3.1,2.3] -> 2.3 (*)
+--- org.slf4j:slf4j-api:1.7.28
\--- com.fasterxml.jackson.core:jackson-databind:2.10.1
     +--- com.fasterxml.jackson.core:jackson-annotations:2.10.1
     \--- com.fasterxml.jackson.core:jackson-core:2.10.1

It turns out, that one of the dependencies: com.github.stephenc.jcip:jcip-annotations:1.0-1 cannot be loaded into Karaf because it is not an OSGi bundle - so, activation of both oauth2-oidc-sdk and msal4j fails.

How can I use msal4j bundle satisfying all the dependencies? Could you list all bundle dependencies to include?

SomkaPe commented 4 years ago

from MANIFEST.MF : ... Import-Package: com.fasterxml.jackson.annotation;version="[2.10,3)",co m.fasterxml.jackson.core;version="[2.10,3)",com.fasterxml.jackson.dat abind;version="[2.10,3)",com.fasterxml.jackson.databind.node;version= "[2.10,3)",com.nimbusds.jose;version="[8.14,9)",com.nimbusds.jose.cry pto;version="[8.14,9)",com.nimbusds.jose.util;version="[8.14,9)",com. nimbusds.jwt;version="[8.14,9)",com.nimbusds.oauth2.sdk;version="[7.4 ,8)",com.nimbusds.oauth2.sdk.auth;version="[7.4,8)",com.nimbusds.oaut h2.sdk.http;version="[7.4,8)",com.nimbusds.oauth2.sdk.id;version="[7. 4,8)",com.nimbusds.oauth2.sdk.pkce;version="[7.4,8)",com.nimbusds.oau th2.sdk.token;version="[7.4,8)",com.nimbusds.oauth2.sdk.util;version= "[7.4,8)",com.nimbusds.openid.connect.sdk;version="[7.4,8)",com.nimbu sds.openid.connect.sdk.token;version="[7.4,8)",com.sun.net.httpserver ,javax.mail.internet;version="[1.6,2)",javax.net.ssl,javax.xml.namesp ace,javax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,jav ax.xml.transform.stream,javax.xml.xpath,net.minidev.json;version="[2. 3,3)",org.slf4j;version="[1.7,2)",org.w3c.dom ... Export-Package: com.microsoft.aad.msal4j;uses:="com.nimbusds.oauth2.sd k.auth,javax.net.ssl";version="1.6.0" Bundle-Name: msal4j Bundle-Version: 1.6.0 ...

@maciejmalycha Is Import-Package list is what you are looking for ?

paul-mcculloch commented 3 years ago

You can use the Karaf bundle wrap command to add non-bundles; For example:

bundle:install wrap:mvn:com.github.stephenc.jcip/jcip-annotations/1.0-1