You may want to get started from here and configurable token lifetime properties.
Generate graph access token wthout browser for online meeting api
So as I read at multiple places, for us to use azure https://graph.microsoft.com/v1.0/me/onlineMeetings api, we would need to use "auth-code grant flow" instead of "client_credentials".
So when using the authorize api i am able to generate the token successfully using the code running in browser
https://login.microsoftonline.com/learningllrts.onmicrosoft.com/oauth2/v2.0/authorize?client_id=f1b12a5e-2d9f-4792-a803-99d85889f5de&scope=openid offline_access OnlineMeetings.ReadWrite&redirect_uri=https://127.0.0.1:8083/&response_type=token&state=12345&response_mode=fragment&prompt=none&nonce=678910&login_hint=sakshi@learningllrts.onmicrosoft.com
This works well in my online meeting api
POST /v1.0/me/onlineMeetings HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Content-Length: 145
{
"startDateTime":"2021-12-30T14:30:34.2444915-07:00",
"endDateTime":"2021-12-30T15:00:34.2464912-07:00",
"subject":"User Token Meeting"
}
PROBLEM- Since it will be integrated in the backend java code, how do i generate the auth code without having to open the browser.
Tried by saving the refresh token and then using it again to generated the access token (since this has shorter lifespan), but i read max refresh token expiry is 90 days?
How can I increase that?
Also, is that right approach to hard code this refresh token in my backend java code and generate access token every time.
1 answer
Sort by: Most helpful
-
Deva-MSFT 2,266 Reputation points Microsoft Employee
2021-01-27T19:25:17.84+00:00