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 Mar 13, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,12 +136,16 @@ Now the library is installed and ready to use. Create a new file called `authHel
136
136
137
137
```js
138
138
var credentials = {
139
-
clientID:'YOUR APP ID HERE',
140
-
clientSecret:'YOUR APP PASSWORD HERE',
141
-
site:'https://login.microsoftonline.com/common',
142
-
authorizationPath:'/oauth2/v2.0/authorize',
143
-
tokenPath:'/oauth2/v2.0/token'
144
-
}
139
+
client: {
140
+
id:'YOUR APP ID HERE',
141
+
secret:'YOUR APP PASSWORD HERE',
142
+
},
143
+
auth: {
144
+
tokenHost:'https://login.microsoftonline.com',
145
+
authorizePath:'common/oauth2/v2.0/authorize',
146
+
tokenPath:'common/oauth2/v2.0/token'
147
+
}
148
+
};
145
149
var oauth2 =require('simple-oauth2')(credentials);
146
150
147
151
var redirectUri ='http://localhost:8000/authorize';
@@ -151,7 +155,7 @@ var scopes = [ 'openid',
151
155
'https://outlook.office.com/mail.read' ];
152
156
153
157
functiongetAuthUrl() {
154
-
var returnVal =oauth2.authCode.authorizeURL({
158
+
var returnVal =oauth2.authorizationCode.authorizeURL({
155
159
redirect_uri: redirectUri,
156
160
scope:scopes.join('')
157
161
});
@@ -162,7 +166,7 @@ function getAuthUrl() {
162
166
exports.getAuthUrl= getAuthUrl;
163
167
```
164
168
165
-
The first thing we do here is define our client ID and secret. We also define a redirect URI and an array of scopes. The scope array includes the `openid` and `Mail.Read` scopes, since we will only read the user's mail. The values of `clientId` and `clientSecret` are just placeholders, so we need to generate valid values.
169
+
The first thing we do here is define our client ID and secret. We also define a redirect URI and an array of scopes. The scope array includes the `openid` and `Mail.Read` scopes, since we will only read the user's mail. The values of `id` and `secret` are just placeholders, so we need to generate valid values.
166
170
167
171
### Generate a client ID and secret ###
168
172
@@ -260,7 +264,7 @@ Let's add another helper function to `authHelper.js` called `getTokenFromCode`.
0 commit comments