You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/auth.md
+62-12Lines changed: 62 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,9 @@ To authenticate your app to use OneDrive, you need to get a `OneDriveClient`, wh
5
5
6
6
**Note** This topic assumes that you are familiar with app authentication. For more info about authentication in OneDrive, see [Authentication for the OneDrive API](https://dev.onedrive.com/auth/readme.htm).
7
7
8
-
## Simple authentication
9
-
The easiest way to get an authenticated client is to call `GetMicrosoftAccountClient`, which returns a `OneDriveClient` object, and then call `AuthenticateAsync` on the resulting object:
|_scopes_| Permissions that your app requires from the user. Required. |
25
17
|_client\_secret_| The client secret created for your app. Optional. Not available for Windows Store 8.1, Windows Phone 8.1, and Universal Windows Platform (UWP) apps. |
26
18
27
-
In addition to _clientId_, _returnURL_, _scopes_, and _client\_secret_ the method takes in implementations for a credential cache, HTTP provider, and a service info provider or web authentication UI. If not provided, the default implementations of each item will be used.
19
+
In addition to _clientId_, _returnURL_, _scopes_, and _client\_secret_ the method takes in implementations for a client type, credential cache, HTTP provider, and a service info provider or web authentication UI. If not provided, the default implementations of each item will be used.
20
+
21
+
### ClientType
22
+
A single client can only call OneDrive for Consumer or OneDrive for Business, not both. The service type is specified via passing ClientType `Personal` or `Business` to the client. The default client type is `Personal`.
23
+
24
+
If the application would like to interact with both OneDrive for Consumer and OneDrive for Business a client should be created for each.
28
25
29
26
### CredentialCache
30
27
@@ -42,6 +39,19 @@ The service info provider is responsible for providing information for accessing
42
39
43
40
When you use the default `IServiceInfoProvider` and `IAuthenticationProvider` implementations, an `IWebAuthenticationUi` implementation is required to display authentication UI to the user. Default implementations are available for WinForms, Windows 8.1, Windows Phone 8.1, and UWP applications. If no `IWebAuthenticationUi` implementation is present, only the silent authentication flow will be used.
44
41
42
+
# Microsoft account (MSA) authentication
43
+
## Simple authentication
44
+
The easiest way to get an authenticated client is to use one of the `OneDriveClient` extensions and call `AuthenticateAsync` on the resulting client:
The OneDriveClient extensions are available based on the build target of the project. For Windows 8.1, Windows Phone 8.1, and UWP projects, there are three available methods depending on which Windows authentication API is used to retrieve a client:
69
+
The OneDriveClient extensions available are based on the build target of the project. For Windows 8.1, Windows Phone 8.1, and UWP projects, there are three available methods depending on which Windows authentication API is used to retrieve a client:
60
70
61
71
*`GetClientUsingOnlineIdAuthenticator`
62
72
*`GetClientUsingWebAuthenticationBroker`
@@ -91,3 +101,43 @@ To sign out you can call:
91
101
```csharp
92
102
awaitoneDriveClient.SignOutAsync();
93
103
```
104
+
105
+
# Azure Active Directory (AAD) authentication
106
+
107
+
The SDK uses [ADAL](https://github.com/AzureAD/azure-activedirectory-library-for-dotnet) for authentication against AAD. Implementations are available for WinForms, Windows 8.1, and UWP apps. Due to technical limitations, **Windows Phone 8.1 is not supported**.
108
+
109
+
## Caching credentials
110
+
111
+
Since ADAL has its own caching model, AAD authentication has its own CredentialCache implementation for caching, the AdalCredentialCache, that wraps the ADAL caching functionality. The mechanisms for interacting with the cache are the same as with Credential Cache but it can only be used for AAD credential caching. If a CredentialCache is provided that is not an AdalCredentialCache operations will bypass writing to it.
112
+
113
+
## Authentication using the discovery service
114
+
115
+
In the case where the OneDrive for Business API endpoint and resource ID aren't known it is possible to authenticate using the [discovery service](https://msdn.microsoft.com/en-us/office/office365/howto/discover-service-endpoints).
## Authentication using the OneDrive for Business API endpoint and resource ID
124
+
125
+
If the OneDrive for Business API endpoint and resource ID are already known they can be provided to the client and authentication will not route through the discovery service.
Copy file name to clipboardExpand all lines: docs/collections.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,5 +71,4 @@ var deltaCollectionPage = await oneDriveClient
71
71
.GetAsync();
72
72
```
73
73
74
-
`IItemDeltaCollectionPage` is an `ICollectionPage<Item>` object with a `Token` property and a `DeltaLink` property. The token link can be used to pass into `Delta:` when you want to check for more changes. You can also construct a delta request with the `DeltaLink` property. The `NextPageRequest` is an `IItemDeltaRequest` to be used for paging purposes and will be null when there are no more changes.
75
-
74
+
`IItemDeltaCollectionPage` is an `ICollectionPage<Item>` object with a `Token` property and a `DeltaLink` property. The token link can be used to pass into `Delta:` when you want to check for more changes. You can also construct a delta request with the `DeltaLink` property. The `NextPageRequest` is an `IItemDeltaRequest` to be used for paging purposes and will be null when there are no more changes.
0 commit comments