Score:0

How to change the Microsoft account for OneDrive in Ubuntu

lk flag

I have installed onedrive (version v2.4.13-9-g7857a50) on Ubuntu 20.04 LTS.

After using my (test) microsoft account I want to use my "production" microsoft account.

I did the following : rename ~/.config/onedrive/refresh_token into refresh_token_backup and removed the originale file. After starting Onedrive it still uses my test MS-account.

Have someone a solution for me ?

rgds pvdb

Score:0
kr flag

I did the following : rename ~/.config/onedrive/refresh_token into refresh_token_backup and removed the originale file. After starting Onedrive it still uses my test MS-account.

This is not the correct process.

To switch accounts you need to use onedrive --logout to correctly log you out of your existing account, and then re-authenticate the client with your correct account.

This is the only way (and correct way) to do this.

Alternatively, use the --confdir option to specify a different configuration directory for each account type, so you can have:

  • onedrive --confdir ~/.config/onedrive-test-account/ <other-required-options>
  • onedrive --confdir ~/.config/onedrive-production/ <other-required-options>
Score:0
lk flag

Thanks for your answer. I did the following :

nt8356@cobol:~$ onedrive --logout

Configuration file successfully loaded Configuring Global Azure AD Endpoints Authorize this app visiting: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&scope=Files.ReadWrite Files.ReadWrite.all Sites.Read.All Sites.ReadWrite.All offline_access&response_type=code&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient

Enter the response uri: https://login.microsoftonline.com/common/oauth2/nativeclient?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Application has been successfully authorised, however no additional command switches were provided. Please use --help for further assistance in regards to running this application.*

nt8356@cobol:~$

( I replaced the client_id and code by xx)

The result is that onedrive still uses my test microsoft account

Maybe I am doing something not correctly ?

rgds

abraunegg avatar
kr flag
Did you enter in your 'production' credentials when visiting the authentication URL or did the browser automatically log you in? Were you asked enter your 'production' account credentials - or did the browser 'cache' your 'test' credentials?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.