Skip to content

docs: Explain the meaning of OneDrive access token #4715

Closed

Description

@intgr

For background: the Rustic backup tool uses OpenDAL for cloud storage integration. The documentation is lacking on both sides. But I managed to reverse engineer that it expects the user to configure OpenDAL root & access_token (https://opendal.apache.org/docs/rust/opendal/services/struct.Onedrive.html#configuration) for OneDrive in a configuration file.

But there is no documentation on either side, what process needs to be performed to get an access token issued. Is this even something that a user should be exposed to? Or is it the application author's responsibility to provide a mechanism for requesting the access token?

But at the bare minimum, OpenDAL's documentation should document the expected format of this token (e.g. JWT token?) and reference relevant parts of Microsoft Graph API, and perhaps suggest a tool or library that can be used to request one.

Related discussion: #2129 (comment)

Activity

  1. intgr commented on Jun 10, 2024

    @intgr
    Author

    Cross-posting relevant replies from @imWildCat #2129 (comment)

    To get a working access_token for OneDrive, we can leverage https://crates.io/crates/graph-rs-sdk, especially its demo: https://github.com/sreeise/graph-rs-sdk/tree/master/examples/oauth

    From #2129 (comment)

    If you'd like to check some tutorials, I did find a quick for you: https://www.youtube.com/watch?v=NljQx11YqNY

    In general, OAuth flows for these big techs are pretty complex, sometimes replying on their own SDKs by default. I was working in MSFT. So I knew this very well. For example, if you'd like to use Graph API on iOS/macOS, you might want https://github.com/AzureAD/azure-activedirectory-library-for-objc Why this flow is always complicated? Because they must respect users' privacy and also data compliance, like GDPR. So it is always required something like "User Consent".

    The goal of OpenDAL is just a light-weight wrapper of some data uploading / downloading apis. So this lib is not depending on any of these first-party SDKs provided by the service companies.

    In my own company, I write these logic into Rust directly, referring to the sample code link I shared above. You'd better check them out before being surprised here. This flow would be easier for you if you write them in Rust for all the other big ones, like Google and/or Dropbox.

  2. Xuanwo commented on Jun 10, 2024

    @Xuanwo
    Member

    Thanks a lot for raising up an issue. I'm going to setup the integration tests for one drive. Maybe I can finish the documentation at the same time.

    And you are welcomed to provide a minimum PR to improve the existing docs a bit 🥰

  3. Xuanwo commented on Mar 11, 2025

    @Xuanwo
    Member

    Should be addressed by #5733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions