OneDrive / onedrive-sdk-dotnet-msa-auth-adapter

Other
26 stars 22 forks source link

Can the examples be more specific? #35

Open ivannp opened 7 years ago

ivannp commented 7 years ago

It's extremely frustrating for new users. There are variables which is not shown what they are set to, and sometimes are deprecated. For example:

var msaAuthProvider = new MsaAuthenticationProvider(
    clientId,
    returnUrl,
    scopes,
    /*CredentialCache*/ null,
    new CredentialVault(clientId));
authTask = msaAuthProvider.RestoreMostRecentFromCacheOrAuthenticateUserAsync();
app.OneDriveClient = new OneDriveClient(this.oneDriveConsumerBaseUrl, msaAuthProvider);

First it seems that this code fragment is outdated based on the latest version of the library.

My biggest frustration was with oneDriveConsumerBaseUrl - no explanation where it comes from. Not even an example so that we can try to deduce its meaning.

Even for clientId and returnUrl it would have been useful to show an example what they are, and more importantly, where to get them from.

A simple 5-10 line command line example, showing the different authentication types, including non UWP, desktop apps would have been much more helpful IMO. Check GoogleDrive examples.

kevitra commented 7 years ago

I agree. I have spent a lot of time trying to figure this out and it isn't clear at all.

escape-llc commented 6 years ago

@kevitra if you figured out stuff, can you share it here? I agree it is far from useful. Here, I'll start!

I was able to determine that:

  1. clientId is the GUID you get from registering your application for Graph API. Nothing works right until you complete this step! My page showed two different kinds of app registration, and you must use Converged Applications not Live SDK!
  2. returnUrl is actually a fixed value for e.g. desktop: https://login.live.com/oauth20_desktop.srf I didn't save the URL where that tidbit showed up; I think the OAuth2 topics had it.
  3. userId (not shown here but one of the parameters) i think is the value from CurrentAccountSession.UserId.
AndersRisager commented 6 years ago

All sample projects like "OneDriveApiBrowser" for standard winform should be updated to include refresh tokens.

What app would not want to use this or at least demonstrate how to.

Does Microsoft not care about this? Why are you not replying to the issues?

How to integrate to OneDrive keeps changing and MS is forcing businesses to change from the deprecated "OneDrive Rest Api", so please make sure the SDK has updated samples and documentation.

It's hard to believe this post 13 months old.