-
Notifications
You must be signed in to change notification settings - Fork 145
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
How to Authenticate in ASP.NET with Business Account using SDK #45
Comments
Correct, 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. |
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 |
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. |
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. |
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! |
Hi Ginach, I currently can't find a way to authenticate OneDrive from ASP.NET MVC. Is there any sample available yet? |
Our webhooks sample is an example MVC app. |
Do you have a guide on how to do this?
I tried to use the simple authentication below
var oneDriveClient = OneDriveClient.GetMicrosoftAccountClient(
clientId,
returnUrl,
scopes);
await oneDriveClient.AuthenticateAsync();
I noticed that after creating the client, the ClientType is set as "Consumer"
I read in this Issue
#23
That I might to create a class that implements IWebAuthenticationUi
Do you have a sample for that?
many thanks
Philip
The text was updated successfully, but these errors were encountered: