Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Resetting password through Graph API does not writeback

$
0
0

I am resetting a users password using the 'me' keyword in the following API call:

https://graph.windows.net/me/changePassword

However this doesn't seem to write back through AD Connect on premises. If I reset the password through myapps.microsoft.com then this does a writeback as expect. Would anyone know what could be the issue here? The method I'm using if helpful is here:

public HttpStatusCode ChangePassword(string curPassword, string newPass)
        {
            var client = new HttpClient();
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", UserAccessToken);

            var requestUri = $"https://graph.windows.net/me/changePassword?api-version={Constants.ApiVersion}";

            var pwdObject = new { currentPassword = curPassword, newPassword = newPass };
            var body = new JavaScriptSerializer().Serialize(pwdObject);
            var response = client.PostAsync(new Uri(requestUri), new StringContent(body, Encoding.UTF8, "application/json")).Result;

            return response.StatusCode;
        }


Please don't forget to mark posts as helpful or answers.
Inframon Blogs | All Things ConfigMgr


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>