Skip to content

Commit af6db7c

Browse files
authored
Updating the samples folder (#477)
* removing node and browser; adding largefile samples * adding links of samples in docs * token credential readme change
1 parent dde2550 commit af6db7c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1579
-22070
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ src/**/*.d.ts
2222

2323
samples/**/secrets.ts
2424
samples/**/secrets.js
25-
samples/node/secrets.json
26-
samples/browser/src/secrets.js
27-
samples/browser/src/graph-js-sdk.js
28-
samples/browser/src/graph-es-sdk.js
25+
samples/node_modules/**
26+
samples/lib/
2927

3028
test/development/secrets.ts
3129

README.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,22 @@ The Microsoft Graph JavaScript client library is a lightweight wrapper around th
2929
- [Page Iteration](docs/tasks/PageIterator.md)
3030
- [Getting Raw Response](docs/GettingRawResponse.md)
3131
- [Creating an instance of TokenCredentialAuthenticationProvider](docs/TokenCredentialAuthenticationProvider.md)
32-
- [Samples and tutorials](#samples-and-tutorials)
33-
- Step-by-step training exercises on creating a basic application using the Microsoft Graph JavaScript SDK:
34-
- [Build Angular single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/angular)
35-
- [Build Node.js Express apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/node)
36-
- [Build React Native apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react-native)
37-
- [Build React single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react)
38-
- [Build JavaScript single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/javascript)
39-
- [Explore Microsoft Graph scenarios for JavaScript development](https://docs.microsoft.com/learn/paths/m365-msgraph-scenarios/)
40-
- Samples using `TokenCredentialAuthenticationProvider` with the `@azure/identity` library:
41-
- [TokenCredentialAuthenticationProvider Samples](samples/tokenCredentialSamples)
42-
- Samples to learn more about authentication using `MSAL`libraries:
43-
- [Azure-Sample Vanilla JS SPA using MSAL Browser and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/2-Authorization-I/1-call-graph)
44-
- [ Azure-Sample Angular SPA using MSAL Angular and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/2-Authorization-I/1-call-graph)
45-
- [ Azure-Sample React SPA using MSAL React and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/2-Authorization-I/1-call-graph)
32+
- [Samples and tutorials](#samples-and-tutorials)
33+
- Step-by-step training exercises on creating a basic application using the Microsoft Graph JavaScript SDK:
34+
- [Build Angular single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/angular)
35+
- [Build Node.js Express apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/node)
36+
- [Build React Native apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react-native)
37+
- [Build React single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react)
38+
- [Build JavaScript single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/javascript)
39+
- [Explore Microsoft Graph scenarios for JavaScript development](https://docs.microsoft.com/learn/paths/m365-msgraph-scenarios/)
40+
- Samples using `TokenCredentialAuthenticationProvider` with the `@azure/identity` library:
41+
- [TokenCredentialAuthenticationProvider Samples](samples/)
42+
- Samples using `LargeFileUploadTask` and `OneDriveLargeFileTask`:
43+
- [LargeFileUploadTask Samples](samples/)
44+
- Samples to learn more about authentication using `MSAL`libraries:
45+
- [Azure-Sample Vanilla JS SPA using MSAL Browser and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/2-Authorization-I/1-call-graph)
46+
- [ Azure-Sample Angular SPA using MSAL Angular and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/2-Authorization-I/1-call-graph)
47+
- [ Azure-Sample React SPA using MSAL React and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/2-Authorization-I/1-call-graph)
4648
- [Questions and comments](#questions-and-comments)
4749
- [Contributing](#contributing)
4850
- [Additional resources](#additional-resources)
@@ -162,22 +164,27 @@ For more information, refer: [Calling Pattern](docs/CallingPattern.md), [Actions
162164
## Samples and tutorials
163165

164166
Step-by-step training exercises that guide you through creating a basic application that accesses data via the Microsoft Graph:
165-
- [Build Angular single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/angular)
166-
- [Build Node.js Express apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/node)
167-
- [Build React Native apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react-native)
168-
- [Build React single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react)
169-
- [Build JavaScript single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/javascript)
170-
- [Explore Microsoft Graph scenarios for JavaScript development](https://docs.microsoft.com/learn/paths/m365-msgraph-scenarios/)
167+
168+
- [Build Angular single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/angular)
169+
- [Build Node.js Express apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/node)
170+
- [Build React Native apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react-native)
171+
- [Build React single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/react)
172+
- [Build JavaScript single-page apps with Microsoft Graph](https://docs.microsoft.com/graph/tutorials/javascript)
173+
- [Explore Microsoft Graph scenarios for JavaScript development](https://docs.microsoft.com/learn/paths/m365-msgraph-scenarios/)
171174

172175
The Microsoft Graph JavaScript SDK provides a `TokenCredentialAuthenticationProvider` to authenticate using the `@azure/identity` auth library. Learn more:
173-
- [Creating an instance of TokenCredentialAuthenticationProvider](docs/TokenCredentialAuthenticationProvider.md)
174-
- [TokenCredentialAuthenticationProvider Samples](samples/tokenCredentialSamples)
175176

176-
The following `MSAL` samples provide information on authentication using `MSAL` libraries and how to use the Microsoft Graph JavaScript SDK client with MSAL as a custom authentication provider to query the Graph API:
177+
- [Documentation for creating an instance of TokenCredentialAuthenticationProvider](docs/TokenCredentialAuthenticationProvider.md)
178+
- [TokenCredentialAuthenticationProvider Samples](samples/)
179+
180+
The Microsoft Graph JavaScript SDK provides a `LargeFileUploadTask` to upload large files to OneDrive, Outlook and Print API:
181+
182+
- [LargeFileUploadTask documentation](docs/tasks/LargeFileUploadTask.md)
183+
- [Samples using `LargeFileUploadTask` and `OneDriveLargeFileTask`](samples/) The following `MSAL` samples provide information on authentication using `MSAL` libraries and how to use the Microsoft Graph JavaScript SDK client with MSAL as a custom authentication provider to query the Graph API:
177184

178-
- [Azure-Sample Vanilla JS SPA using MSAL Browser and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/2-Authorization-I/1-call-graph)
179-
- [Azure-Sample Angular SPA using MSAL Angular and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/2-Authorization-I/1-call-graph)
180-
- [Azure-Sample React SPA using MSAL React and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/2-Authorization-I/1-call-graph)
185+
- [Azure-Sample Vanilla JS SPA using MSAL Browser and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/2-Authorization-I/1-call-graph)
186+
- [Azure-Sample Angular SPA using MSAL Angular and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/2-Authorization-I/1-call-graph)
187+
- [Azure-Sample React SPA using MSAL React and Microsoft Graph JavaScript SDK](https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/2-Authorization-I/1-call-graph)
181188

182189
## Questions and comments
183190

docs/TokenCredentialAuthenticationProvider.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
- [npm - Azure Identity client library for JavaScript](https://www.npmjs.com/package/@azure/identity)
88

9-
- Check the [tokenCredentialSamples folder](../samples/tokencredentialsamples). The ClientSecretCredentialFlow is an example of using TokenCredential to authenticate a node application. The AuthenticationCodeFlow is an example of using TokenCredential to authenticate a browser application.
10-
11-
**Important Note:** TokenCredentials can be used to authenticate browser and node applications.
9+
- Check the [javascript](../samples/javascript/clientInitialization/tokenCredentialAuthenticationProvider/index.js) and [typescript](../samples/typescript/clientInitialization/tokenCredentialAuthenticationProvider/index.ts)`TokenCredentialAuthenticationProvider` samples . The ClientSecretCredentialFlow is an example of using TokenCredential to authenticate a node application. **Important Note:** TokenCredentials provides support for multiple authentication flows. This includes support to authenticate server applications.
1210

1311
###### Example of how to create and pass a token credential -
1412

docs/tasks/LargeFileUploadTask.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ const uploadSession = LargeFileUploadTask.createUploadSession(client, "REQUEST_U
4747

4848
#### Creating the LargeFileUploadTask object
4949

50-
- To create the LargeFileUploadTask object you need to create -
51-
- An upload session as shown above.
52-
- A `FileObject` instance.
50+
- First, you will need to initialize a [Client instance](../CreatingClientInstance.md). This `client` instance should passed as a parameter when creating the `LargeFileUploadTask` or `OneDriveLargeFileUploadTask` object.
51+
- To create the LargeFileUploadTask object you need to create - - An upload session as shown above. - A `FileObject` instance.
5352

5453
**FileObject Interface**
5554

@@ -185,3 +184,11 @@ _Returns the largeFileUpload session information containing the URL, expiry date
185184
```typescript
186185
const uploadsession: LargeFileUploadSession = uploadTask.getUploadSession();
187186
```
187+
188+
## Samples
189+
190+
Check out the samples for:
191+
192+
- LargeFileUploadTask - [JavaScript](../../samples/javascript/tasks/LargeFileUploadTask.js) - [Typescript](../../samples/typescript/tasks/LargeFileUploadTask.ts)
193+
194+
- OneDriveLargeFileUploadTask - [JavaScript](../../samples/javascript/tasks/OneDriveLargeFileUploadTask.js) - [TypeScript](../../samples/typescript/tasks/OneDriveLargeFileUploadTask.ts)

samples/browser/.lightrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

samples/browser/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)