AzureAD / azure-activedirectory-library-for-java

MIT License
161 stars 126 forks source link

object aad is not a member of package com.microsoft #291

Closed sara85sara closed 4 years ago

sara85sara commented 4 years ago

I am getting following message in databricks, even though I have installed adal4j package.

import com.microsoft.aad.adal4j.ClientCredential import com.microsoft.aad.adal4j.AuthenticationContext import java.util.concurrent.Executors

val TenantId = "**"; val authority = "https://login.windows.net/" + TenantId; val resourceAppIdURI = "https://database.windows.net/"; val ServicePrincipalId = "**"; val ServicePrincipalPwd = "*****";

val service = Executors.newFixedThreadPool(1); val context = new AuthenticationContext(authority, true, service);

//Get access token val ClientCred = new ClientCredential(ServicePrincipalId, ServicePrincipalPwd); val authResult = context.acquireToken(resourceAppIdURI, ClientCred, null); val accessToken = authResult.get().getAccessToken

command-2686928155452854:3: error: object aad is not a member of package com.microsoft import com.microsoft.aad.adal4j.AuthenticationContext ^ command-2686928155452854:13: error: not found: type AuthenticationContext val context = new AuthenticationContext(authority, true, service); ^ command-2686928155452854:2: error: object aad is not a member of package com.microsoft import com.microsoft.aad.adal4j.ClientCredential ^ command-2686928155452854:16: error: not found: type ClientCredential val ClientCred = new ClientCredential(ServicePrincipalId, ServicePrincipalPwd);

sangonzal commented 4 years ago

@sara85sara How did you add adal4j into your project?

sara85sara commented 4 years ago

I installed from maven library package from databricks... Now I have un-installed the package by downloading the jar from maven and loaded back to databricks DFS. now getting the token. but its not consistent.. I have restart the cluster everytime...

sangonzal commented 4 years ago

@sara85sara this is a question for the databricks team, nothing we can do on our end.