question

jubinglong-1350 avatar image
0 Votes"
jubinglong-1350 asked jubinglong-1350 commented

Azure Graph API transaction

Hello,

I using Azure AD(free) to store user login information.
When I want change user's password in my application by application way(appID, appSecurity).
But changePassword not support application way.
So I send two graph api: first delete user, second add user.
But how can I keep the two times call all success or all failure. (in a transaction)
User user = graphServiceClient.users(id).buildRequest().get();
// first : delete the user
graphServiceClient.users(id).buildRequest().delete(user);

// second: add user
PasswordProfile passwordProfile = new PasswordProfile();
passwordProfile.forceChangePasswordNextSignIn = true;
passwordProfile.password = "Abc,123.";
user.passwordProfile = passwordProfile;
graphServiceClient.users(id).buildRequest().post(userInfo);


Best wishes.

azure-ad-graph
· 1
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, we are investigating your issue and will update you shortly.

Best,
James

0 Votes 0 ·

1 Answer

JamesHamil-MSFT avatar image
0 Votes"
JamesHamil-MSFT answered jubinglong-1350 commented

Hi @jubinglong-1350 , your workaround method seems a bit complicated. We should try to get changePassword working for you instead. Have you made sure that you have the appropriate permissions for this?

 Directory.AccessAsUser.All

Unless you're using the unsupported types, which I assume you are? Are you just trying to change the users passwords? Have you looked into SSPR? If not, please let me know what your use case is and I can find a better solution for you.

Best,
James


· 1
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.

Thanks for answer.

The application has the auth as follows.

D

irectory.AccessAsUser.All

SSPR need AD P1 or P2(P1 or P2 is need money)
This application is currently in exploratory phase,Not enough budget. And The application will be trialed for a period of time.
In trial period,we want to use graph api to avoid the question with Azure AD(free).

Best wishes~


0 Votes 0 ·