Hello, my app start to face issues trying to call this api -> https://graph.microsoft.com/v1.0/places/microsoft.graph.room
we are getting this error:
{
"error":{
"code":"UnknownError",
"message":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">rn\<html xmlns=\"" http://www.w3.org/1999/xhtml"">rn\<head>rn<meta http-equiv=\""Content-Type\" content=\"text/html; charset=iso-8859-1\"/>\r\n<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div class=\"content-container\"><fieldset>\r\n <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2>\r\n <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\r\n </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n",
"innerError":{
"date":"2022-06-21T14:21:50",
"request-id":"f8f6a53c-114a-41a4-b267-22a09bc66561",
"client-request-id":"f8f6a53c-114a-41a4-b267-22a09bc66561"
}
}
}
The app was working fine until last week but start to fail. Unlucky we were researching in Internet and try a lot of workaround but get the same error every time, we registered a new app in azure portal (generate new clientid, secrets).
We were trying enabling delegate and application permissions -> Place.Read.All, but we got same error in both cases.
About token we are using DelegateAuthenticationProvider with next function:
var result = await app.AcquireTokenForClient(new[] { " https://graph.microsoft.com/.default" }).ExecuteAsync();
Token is generated correctly but once we send the request to get places api we received the error above.
This is the token information:
"typ": "JWT",
"nonce": "eJyyqwcKLPs3RKvhJhz6G8rznlsS4aRCPVn0klOmpgw",
"alg": "RS256",
"x5t": "jS1Xo1OWDj_52vbwGNgvQO2VzMc",
"kid": "jS1Xo1OWDj_52vbwGNgvQO2VzMc"
}.{
"aud": "https://graph.microsoft.com",
"iss": "https://sts.windows.net/0cf9ef8d-c4a6-48db-8903-5c41ea2dcb1f/",
"iat": 1655831847,
"nbf": 1655831847,
"exp": 1655835747,
"aio": "E2ZgYOg4qv7qZsTRKv5v+6RzDrpKAgA=",
"app_displayname": "enplug-room-calendar-NA",
"appid": "e24a8d18-12cf-4fe4-8676-2674f1025f52",
"appidacr": "1",
"idp": "https://sts.windows.net/0cf9ef8d-c4a6-48db-8903-5c41ea2dcb1f/",
"idtyp": "app",
"oid": "7b35ae2f-956e-4e15-bd40-e0c59cd04dec",
"rh": "0.ARsAje_5DKbE20iJA1xB6i3LHwMAAAAAAAAAwAAAAAAAAAAbAAA.",
"roles": [
"Place.Read.All"
],
"sub": "7b35ae2f-956e-4e15-bd40-e0c59cd04dec",
"tenant_region_scope": "NA",
"tid": "0cf9ef8d-c4a6-48db-8903-5c41ea2dcb1f",
"uti": "f-eNnJYmoUekjdAqTosBAA",
"ver": "1.0",
"wids": [
"0997a1d0-0d1d-4acb-b408-d5ca73121e90"
],
"xms_tcdt": 1438115492
}.[Signature]
Thanks in advice.