Skip to content

Commit 22233e9

Browse files
sjha2048Sahil
and
Sahil
authored
fix(samples): added secrets file and updated documentation (microsoftgraph#517)
Co-authored-by: Sahil <[email protected]>
1 parent 4edb1e0 commit 22233e9

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ src/**/*.js.map
2121
src/**/*.d.ts
2222

2323
samples/**/secrets.ts
24-
samples/**/secrets.js
2524
samples/node_modules/**
2625
samples/lib/
2726

samples/javascript/clientInitialization/tokenCredentialAuthenticationProvider/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
4. Navigate to the samples folder [./samples]and run `npm install`
2020

21-
5. Navigate to tokenCredentialAuthenticationProvider[./samples/javascript/clientInitialization/tokenCredentialAuthenticationProvider] in the samples directory.
21+
5. Navigate to secrets.js[./secrets] and populate all the values (tenantId, clientId, clientSecret, scopes)
2222

23-
6. For running this javascript sample, run `node index.js`
23+
6. Navigate to tokenCredentialAuthenticationProvider[./samples/javascript/clientInitialization/tokenCredentialAuthenticationProvider] in the samples directory.
24+
25+
7. For running this javascript sample, run `node index.js`

samples/javascript/clientInitialization/tokenCredentialAuthenticationProvider/index.js

-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ const { clientId, clientSecret, scopes, tenantId } = require("./secrets");
1313
require("isomorphic-fetch");
1414

1515
const port = "<PORT_NUMBER>";
16-
const tenantId = "<TENANT_ID>";
17-
const clientId = "<CLIENT_ID>";
18-
const clientSecret = "<CLIENT_SECRET>";
19-
const scopes = "<SCOPE>";
2016
const redirectUri = `http://localhost:${port}/authresponse`;
2117
const authorityHost = "https://login.microsoftonline.com";
2218

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const tenantId = "<TENANT_ID>";
2+
const clientId = "<CLIENT_ID>";
3+
const clientSecret = "<CLIENT_SECRET>";
4+
const scopes = "<SCOPE>";
5+
6+
module.exports = {
7+
tenantId: tenantId,
8+
clientId: clientId,
9+
clientSecret: clientSecret,
10+
scopes: scopes
11+
}

0 commit comments

Comments
 (0)