Skip to content

Commit 6bc8a08

Browse files
committed
doc and folder name update
1 parent 9ffd6c5 commit 6bc8a08

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

docs/AuthCodeMSALBrowserAuthenticationProvider.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Using npm:
2929
```typescript
3030
import { PublicClientApplication, InteractionType, AccountInfo } from "@azure/msal-browser";
3131

32-
import { AuthCodeMSALBrowserAuthenticationProvider, AuthCodeMSALBrowserAuthenticationProviderOptions } from "@microsoft/microsoft-graph-client/authProviders/msal-browser";
32+
import { AuthCodeMSALBrowserAuthenticationProvider, AuthCodeMSALBrowserAuthenticationProviderOptions } from "@microsoft/microsoft-graph-client/authProviders/authCodeMsalBrowser";
3333

3434
const options:AuthCodeMSALBrowserAuthenticationProviderOptions: {
3535
account: account, // the AccountInfo instance to acquire the token for.

docs/CreatingClientInstance.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ In order to instantiate a Client object, one has to pass in the `authProvider` o
1111
### Option A. Default Middleware chain
1212

1313
The default middleware chain contains consecutively chained instances of the following:
14-
- [AuthenticationHandler](../src/middleware/AuthenticationHandler.ts)
15-
- [RetryHandler](../src/middleware/RetryHandler.ts)
16-
- [RedirectHandler](../src/middleware/RedirectHandler.ts)
17-
- [TelemetryHandler](../src/middleware/TelemetryHandler.ts)
18-
- [HTTPMessageHandler](../src/middleware/HTTPMessageHandler.ts)
14+
15+
- [AuthenticationHandler](../src/middleware/AuthenticationHandler.ts)
16+
- [RetryHandler](../src/middleware/RetryHandler.ts)
17+
- [RedirectHandler](../src/middleware/RedirectHandler.ts)
18+
- [TelemetryHandler](../src/middleware/TelemetryHandler.ts)
19+
- [HTTPMessageHandler](../src/middleware/HTTPMessageHandler.ts)
1920

2021
To create a client instance with the default middleware chain:
2122

@@ -36,9 +37,9 @@ The Microsoft Graph JavaScript Client Library has an adapter implementation for
3637

3738
> Learn how to [create an instance of TokenCredentialAuthenticationProvider](./TokenCredentialAuthenticationProvider.md).
3839
39-
- **DEPRECATED** ([ImplicitMSALAuthenticationProvider](../src/authentication/msal/ImplicitMSALAuthenticationProvider.ts)) for [MSAL](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core) (Microsoft Authentication Library) which takes care of getting the `accessToken`. MSAL library does not ship with this library, user has to include it externally (For including MSAL, refer [this](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core#installation)).
40+
- ([AuthCodeMSALBrowserAuthenticationProvider](../src/authentication/msal/ImplicitMSALAuthenticationProvider.ts)) for [msal-browser](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser) (Microsoft Authentication Library) which takes care of getting the `accessToken`. `msal-browser` library does not ship with this library, user has to include it externally.
4041

41-
> Learn how to [create an instance of ImplicitMSALAuthenticationProvider](./ImplicitMSALAuthenticationProvider.md).
42+
> Learn how to [create an instance of AuthCodeMSALBrowserAuthenticationProvider](./AuthCodeMSALBrowserAuthenticationProvider.md).
4243
4344
**User can integrate any preferred authentication library by implementing `IAuthenticationProvider` interface**. Refer implementing [Custom Authentication Provider](./CustomAuthenticationProvider.md) for more detailed information.
4445

src/authentication/msal-browser/AuthCodeMSALBrowserAuthenticationProvider.ts

+5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export class AuthCodeMSALBrowserAuthenticationProvider implements Authentication
5656
scopes,
5757
account,
5858
});
59+
if (!response || !response.accessToken) {
60+
error.name = "Access token is undefined";
61+
error.message = "Received empty access token from PublicClientApplication";
62+
throw error;
63+
}
5964
return response.accessToken;
6065
} catch (error) {
6166
if (error instanceof InteractionRequiredAuthError) {

tsconfig-sub-cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"outDir": "authProviders"
88
},
99
"exclude": ["node_modules", "lib", "samples", "test/", "src"],
10-
"include": ["authProviderOptions/azureTokenCredentials/", "authProviderOptions/msal/","authProviderOptions/msal-browser"],
10+
"include": ["authProviderOptions/azureTokenCredentials/", "authProviderOptions/msal/", "authProviderOptions/authCodeMsalBrowser"],
1111
"references": [
1212
{
1313
"path": "./tsconfig-cjs.json"

0 commit comments

Comments
 (0)