Comments (7)
Our webhooks sample is an example MVC app.
from onedrive-sdk-csharp.
Correct, GetMicrosoftAccountClient
returns a OneDrive Consumer client. What you'll want to look into are the static methods in BusinessClientExtensions
. The auth documentation has examples of creating a OneDrive for Business client under "Azure Active Directory (AAD) authentication".
Here's an example of creating a client using client ID and return URL:
var oneDriveClient = BusinessClientExtensions.GetActiveDirectoryClient(clientId, returnUrl);
await oneDriveClient.AuthenticateAsync();
This will use the Discovery Service to look up the service resource ID for authentication as well as the correct base URL for the API endpoint. If you do know these values already you can bypass the Discovery Service by providing them directly:
var oneDriveClient = BusinessClientExtensions.GetActiveDirectoryClient(
clientId,
returnUrl,
oneDriveApiEndpoint,
serviceResourceId)
await oneDriveClient.AuthenticateAsync();
The SDK is currently using ADAL for Business authentication.
from onedrive-sdk-csharp.
Hi Gina,
I get this exception after calling AuthenticateAsync()
{"AADSTS90014: The request body must contain the following parameter: 'client_secret or client_assertion'.\r\nTrace ID: aa40c0d3-81bd-426d-b010-d777dc4a8d44\r\nCorrelation ID: 445f734b-af2e-46fe-8eaf-41c52eee3974\r\nTimestamp: 2016-01-07 06:48:58Z"}
But the constructor does not accept ClientSecret and the oneDriveClient ClientSecret is readonly
from onedrive-sdk-csharp.
I am also getting this error
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
from onedrive-sdk-csharp.
Authentication using client secret isn't fully implemented yet. Issue #36 is tracking this and I'm working on it this week. Apologies for the delay.
The best way to unblock would most likely be to use ADAL directly to obtain the token and build your own IAuthenticationProvider implementation that just appends it to requests. The AdalAuthenticationProvider class is the right place to start if you want to see what's there at the moment.
from onedrive-sdk-csharp.
Hi @ginach, how is it going with the client secret support? I'm using the SharePointClient at the moment, but cound not figure out how to access shared files and folders in my MVC Web App. Will this be easy in the new implementation, like the Graph API? Cheers!
from onedrive-sdk-csharp.
Hi Ginach, I currently can't find a way to authenticate OneDrive from ASP.NET MVC. Is there any sample available yet?
from onedrive-sdk-csharp.
Related Issues (20)
- ItemWithPath can't handle "invalid characters"
- The remote certificate is invalid according to the validation procedure error when using chunked upload
- Is there a step by step guide for how to use the latest SDK in UWP Apps? HOT 3
- Upload large file raise Unsupported segment type HOT 1
- Remove sample projects from this repo ———— 2 years ago???
- Warning NU1608 Detected package version outside of dependency constraint:
- Exception User-Unhandled HOT 4
- Authentication Problem / Failed
- Warning NU1602
- UWP XBox One Can't Interact with Sign In UI
- Not able to upload files to my OneDrive
- ItemWithPath
- Project Abandoned? HOT 3
- How to get refresh token using the GraphServiceClient uaing code flow
- Request() method throws exception
- System.MissingMethodException set_SdkVersionHeaderPrefix HOT 2
- How to use net core to call onedrive? HOT 1
- How to log in with account other than default?
- OneDrive URI Scheme HOT 1
- Invalid property identifier character.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onedrive-sdk-csharp.