Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Failed to obtain Azure Active Directory token

Open
#81 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
azure, r

Research direction

Start by reviewing the get_business_onedrive() and list_shared_items() calls, then reproduce the scheduled Docker execution described in the issue. Compare it with the working local, production, and user-account runs, focusing on the token refresh context. Done means identifying the cause of the failed refresh and documenting a verified corrective change.

Written by the indexing model from the issue text.

Description

Hello,

I have weird problem with my token authentication in One Drive. I created R script which connects with list of xlsx in one shared folder in One Drive. This script is used in R shiny app and as CRON to daily updating data from xlsx to SQL database. I am using token authentication:

one_drive_connection <- get_business_onedrive()
folder <- one_drive_connection$list_shared_items() %>%
filter(name == '{FOLDER_NAME}') %>%
pull(remoteItem) %>%
.[[1]]

Script and token authorization is now working when:

  • I activate script locally;
  • I activate script in application on production server;
  • cron for this script is working on my user account.

It also worked to August 5th as cron in Dockerfile on another user account. But suddenly it stopped working and I am not sure why. The error is:

Loading Microsoft Graph login for default tenant
Access token has expired or is no longer valid; refreshing
Error in process_aad_response(res) :
Bad Request (HTTP 400). Failed to obtain Azure Active Directory token. Message:
AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2023-05-08T12:00:02.9934064Z and was inactive for 90.00:00:00.
Trace ID: d3e47bfc-9a5c-4754-8e99-c6e4bc033a00
Correlation ID: 7b2c4130-f9af-4056-b3ae-4ed3b330feb5
Timestamp: 2023-08-10 01:15:06Z.
Error: Unable to refresh token
Execution halted

I know that in the message there is something about 'token expired' and 'inactivity', but the same token is working in another case (everywhere I used my token, the same). So I think that it's not due to token. Maybe is it due to using this cron in dockerfile? But I created new dockerfile and there is the same problem. Dockerfile was working from the beginning of June 2023.

Is there anybody who can help?

Dominant language
R
Stars
48
Forks
23
Avg merge
4h 2m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/AzureAuth

All issues in Azure/AzureAuth

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.