question

shivasaiyadav-8336 avatar image
0 Votes"
shivasaiyadav-8336 asked JosephXu-MSFT commented

azure-identity - UsernamePasswordCredential/ClientSecretCredential/AuthorizationCodeCredential - unable to get a token for graphserviceClient (JAVA)

Other than the authorization based on the clientID/clientsecret/tenantID for an App registered in AD
do we have any java integration to acquire graphClient with any authorizationCode/ access token to access the onedrive files based on userName/password. thanks in advance

microsoft-authenticatormicrosoft-graph-explorer
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@shivasaiyadav-8336
As tag “office-onedrive-clienr-itpro" focus more on general issues of OneDrive client, but your issue is more related to Authorization, I would remove this tag. Thanks for your understanding.

0 Votes 0 ·

Hi @shivasaiyadav-8336 Would you please provide us with an update on the status of your issue?

0 Votes 0 ·

1 Answer

JosephXu-MSFT avatar image
0 Votes"
JosephXu-MSFT answered JosephXu-MSFT commented

Hi @shivasaiyadav-8336 There is no other way to authenticate. Firstly we all need to register our apps in Azure AD, then add api permissions. graphClient need to get access token form Azure AD.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JosephXu-MSFT But in graph-explorer the authentication is being performed purely based on the username/password.

However, the graphClient obtained from UsernamePasswordCredential is throwing error while accessing onedrive files Tenant does not have a SPO license. but able to access the files from the graph-explorer with same username/password


0 Votes 0 ·

Hi @shivasaiyadav-8336 Graph-explorer has a default app in Azure AD. In other words, Graph-explorer also get a access token from Azure AD. So we need to register an app in Azure AD.

0 Votes 0 ·