I am getting the oath token using below code:
def get_token():
try:
r = requests.post("https://login.microsoftonline.com/" + config_data['TENNANT_ID'] + "/oauth2/token",
data={"grant_type": "client_credentials",
"client_secret": config_data['CLIENT_SECRET'],
"client_id": config_data['CLIENT_ID'],
"resource": "https://graph.microsoft.com"})
if r.status_code == 200:
ret_body = r.json()
return ret_body['access_token']
else:
log.error("Unable to get token from oauth {}, {}".format(r.status_code, r.json()))
return "false"
except Exception as e:
log.error("Exception occurred while getting oauth token {}".format(e))
I am looking for a microsoft graph api through which I can verify the generated oauth token weather its expired or not. Can anyone please point me to some documentation page for this.?

