Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Log when manual Authorization is required when using --auth-files #2475

Closed
OscarVanL opened this issue Aug 22, 2023 · 8 comments
Labels
Enhancement New feature or request Implemented
Milestone

Comments

@OscarVanL
Copy link

OscarVanL commented Aug 22, 2023

Is your feature request related to a problem? Please describe.

Sometimes when my onedrive container is restarted it gets stuck at:

Initializing the OneDrive API ...
Configuring Global Azure AD Endpoints
Using Curl defaults for all HTTP operations

becuse it is waiting for me to re-auth via the authUrl and responseUrl files.

In this scenario, I'd like to alert myself that I need to re-auth, however when the client restarts and doesn't need to re-auth these logs still get output.

This makes it hard for me to (from machine-parsing logs) differentiate between a restart scenario that needs to be re-authed or a restart scenario that does not require re-authing.

Describe the solution you'd like

Output something like: Client requires authentication before proceeding when the client requires manual re-authing that I can grep for.

Describe alternatives you've considered

Instead alerting on the absence of the message "Sync with OneDrive is Complete" for a few hours

Additional context

No response

@OscarVanL OscarVanL added the Feature Request Feature Request | Enhancement Request label Aug 22, 2023
@abraunegg
Copy link
Owner

@OscarVanL
The application already prints the following when a --reauth is needed, or when the existing tokens are invalid:

ERROR: Refresh token invalid, use --reauth to authorize the client again.

and

Refresh token invalid, use --reauth to authorize the client again

It would be worth checking your logs for these messages as they certainly will be printed when the application is advised by the OneDrive API that the existing authentication items are no longer valid - so it should have given you the heads up that the values were invalid.

This being said, there is potentially a gap here that I can see and from what you have pointed out. I will potentially look at this during the the development of v2.5.0 alpha-1 - I am not going to validate any more features and/or additional items with where I am at currently with v2.5.0 alpha-0.

@abraunegg abraunegg added Enhancement New feature or request Future Work - Planning Required and removed Feature Request Feature Request | Enhancement Request labels Aug 22, 2023
@abraunegg abraunegg added this to the v2.5.0 milestone Aug 22, 2023
@OscarVanL
Copy link
Author

Thanks, I'll wait for it to next get de-authed and have a look for that error in my logs. I hadn't noticed it before, but maybe I was not being observent enough.

@abraunegg abraunegg changed the title Feature Request: Log when manual Authorization is required Feature Request: Log when manual Authorization is required when using --auth-files Aug 26, 2023
@abraunegg
Copy link
Owner

@OscarVanL
If you have an opportunity, please can you test v2.5.0-alpha-0.

In this version, when the client is waiting for the auth-files to be present, the following will be presented:

Client requires authentication before proceeding. Waiting for --auth-files elements to be available.

@abraunegg abraunegg linked a pull request Aug 27, 2023 that will close this issue
@abraunegg abraunegg added the In Progress Currently being worked on label Sep 21, 2023
@abraunegg abraunegg linked a pull request Oct 19, 2023 that will close this issue
@abraunegg
Copy link
Owner

@OscarVanL
Please can you respond in regards to testing the PR?

@abraunegg abraunegg removed the In Progress Currently being worked on label Oct 30, 2023
@abraunegg
Copy link
Owner

@OscarVanL

Please can you test the following PR as part of 'onedrive client version v2.5.0-alpha-3' to potentially resolve your issue:

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
git fetch origin pull/2520/head:pr2520
git checkout pr2520

To run the PR, you need to run the client from the PR build directory:

./onedrive <any options needed>

When running the PR, your client version should be: v2.5.0-alpha-3 GitHub version: v2.4.25-35-g3798e1a

@OscarVanL
Copy link
Author

Sorry, I can't see a build directory after checking it out. I tried building, but couldn't get it to work.

@abraunegg
Copy link
Owner

Closing this issue and marking as implemented in v2.5.0 alpha series of code

@abraunegg
Copy link
Owner

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Repository owner locked as resolved and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement New feature or request Implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants