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
Copy file name to clipboardExpand all lines: README.md
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,25 +117,29 @@ You can only authenticate using oauth athentication as Microsoft deprecated basi
117
117
118
118
There are currently two authentication methods:
119
119
120
-
-[Authenticate on behalf of a user](https://docs.microsoft.com/en-us/graph/auth-v2-user?context=graph%2Fapi%2F1.0&view=graph-rest-1.0): Any user will give consent to the app to access it's resources.
120
+
-[Authenticate on behalf of a user](https://docs.microsoft.com/en-us/graph/auth-v2-user?context=graph%2Fapi%2F1.0&view=graph-rest-1.0):
121
+
Any user will give consent to the app to access it's resources.
121
122
This oauth flow is called **authorization code grant flow**. This is the default authentication method used by this library.
122
-
-[Authenticate with your own identity](https://docs.microsoft.com/en-us/graph/auth-v2-service?context=graph%2Fapi%2F1.0&view=graph-rest-1.0): This will use your own identity. This oauth flow is called **client credentials grant flow**.
123
+
-[Authenticate with your own identity](https://docs.microsoft.com/en-us/graph/auth-v2-service?context=graph%2Fapi%2F1.0&view=graph-rest-1.0):
124
+
This will use your own identity (the app identity). This oauth flow is called **client credentials grant flow**.
123
125
124
126
> 'Authenticate with your own identity' is not an allowed method for **Microsoft Personal accounts**.
125
127
126
128
When to use one or the other and requirements:
127
129
128
-
Topic | On behalf of a user | With your own identity
129
-
:---: | :---: | :---:
130
-
**Register the App** | Required | Required
131
-
**Requires Admin Consent** | Only on certain advanced permissions | Yes, for everything
132
-
**App Permission Type** | Delegated Permissions (on behalf of the user) | Application Permissions
**Authentication** | 2 step authentication with user consent | 1 step authentication
137
+
**Auth Scopes** | Required | None
138
+
**Token Expiration** | 60 Minutes without refresh token or 90 days* | 60 Minutes*
139
+
**Login Expiration** | Unlimited if there is a refresh token and as long as a refresh is done within the 90 days | Unlimited
140
+
**Resources** | Access the user resources, and any shared resources | All Azure AD users the app has access to
141
+
**Microsoft Account Type** | Any | Not Allowed for Personal Accounts
142
+
**Tenant ID Required** | Defaults to "common" | Required (can't be "common")
139
143
140
144
**O365 will automatically refresh the token for you on either authentication method. The refresh token lasts 90 days but it's refreshed on each connection so as long as you connect within 90 days you can have unlimited access.*
141
145
@@ -208,7 +212,7 @@ This section is explained using Microsoft Graph Protocol, almost the same applie
208
212
209
213
- When authenticating with your own identity:
210
214
211
-
1. Instantiate an `Account`objectwith the credentials (client idand client secret)andspecifying the parameter `auth_flow_type` to *"credentials"*. You don't need to specify any scopes.
215
+
1. Instantiate an `Account`objectwith the credentials (client idand client secret), specifying the parameter `auth_flow_type` to *"credentials"*. You also need to provide a 'tenant_id'. You don't need to specify any scopes.
212
216
1. Call `account.authenticate`. This call will request a token for you and store it in the backend. No user interaction is needed. The method will store the token in the backend andreturnTrueif the authentication succeeded.
213
217
214
218
For Example:
@@ -219,7 +223,7 @@ This section is explained using Microsoft Graph Protocol, almost the same applie
Usually you will work with the default 'ME' resource, but you can also use one of the following:
533
537
534
-
-**'me'**: the user which has given consent. the default for every protocol. Overwritten when using "with your own identity" authentication method.
538
+
-**'me'**: the user which has given consent. the default for every protocol. Overwritten when using "with your own identity" authentication method (Only available on the authorization auth_flow_type).
535
539
-**'user:user@domain.com'**: a shared mailbox or a user account for which you have permissions. If you don't provide 'user:' will be infered anyways.
536
540
-**'sharepoint:sharepoint-site-id'**: a sharepoint site id.
0 commit comments