Simone
04/21/2023, 2:55 PMTim
04/21/2023, 3:05 PMSimone
04/26/2023, 12:57 AMTim
04/26/2023, 1:00 AMSimone
04/26/2023, 1:03 AMSimone
04/26/2023, 1:03 AMSimone
04/26/2023, 1:04 AMTim
04/26/2023, 1:10 AMcreateObject("java", "java.class")
.
https://learn.microsoft.com/en-us/graph/tutorials/java?tabs=aad&tutorial-step=2
https://cfdocs.org/javagsr
04/26/2023, 1:24 AMTim
04/26/2023, 1:30 AMgsr
04/26/2023, 1:51 AMSimone
04/26/2023, 1:55 AMTim
04/26/2023, 2:04 AMTim
04/26/2023, 2:08 AMTim
04/26/2023, 2:40 AM// Line breaks are for legibility only.
POST <https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token|https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token> HTTP/1.1
Host: <http://login.microsoftonline.com|login.microsoftonline.com>
Content-Type: application/x-www-form-urlencoded
client_id=535fb089-9ff3-47b6-9bfb-4f1264799865
&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default
&client_secret=qWgdYAmab0YSkuL1qKv5bPX
&grant_type=client_credentials
The cf equivalent would be
cfhttp(
method="post", url="<https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token|https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token>", result="jsonResponse") {
cfhttpparam(type="formfield", name="client_id", value="535fb089-9ff3-47b6-9bfb-4f1264799865");
cfhttpparam(type="formfield", name="scope", value="<https://graph.microsoft.com/.default|https://graph.microsoft.com/.default>");
cfhttpparam(type="formfield", name="client_secret", value="qWgdYAmab0YSkuL1qKv5bPX");
cfhttpparam(type="formfield", name="grant_type", value="client_credentials");
}
Coldfusion will handle the url encoding itself, and add the proper content type header, so you don't need to add those yourself. The response containing the access token from MS would be in jsonResponse.filecontent.Simone
04/26/2023, 12:17 PMSimone
04/26/2023, 12:17 PMgsr
04/27/2023, 3:17 PM