Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/TokenCredentialAuthenticationProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// Import the TokenCredential class that you wish to use. This example uses a Client SecretCredential

import { ClientSecretCredential } from "@azure/identity";
import { Client } from "@microsoft/microsoft-graph-client";
import { TokenCredentialAuthenticationProvider, TokenCredentialAuthenticationProviderOptions } from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials";

// Create an instance of the TokenCredential class that is imported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { AuthenticationProviderOptions } from "../../IAuthenticationProviderOpti
/**
* @interface
* A signature represents the Authentication provider options for Token Credentials
* @property {getTokenoptions} [GetTokenOptions] - Defines options for TokenCredential.getToken.
* @property {getTokenOptions} [GetTokenOptions] - Defines options for TokenCredential.getToken.
*/
export interface TokenCredentialAuthenticationProviderOptions extends AuthenticationProviderOptions {
getTokenoptions?: GetTokenOptions;
getTokenOptions?: GetTokenOptions;
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class TokenCredentialAuthenticationProvider implements AuthenticationProv
error.message = "Scopes cannot be empty, Please provide scopes";
throw error;
}
const response = await this.tokenCredential.getToken(scopes, this.authenticationProviderOptions.getTokenoptions);
const response = await this.tokenCredential.getToken(scopes, this.authenticationProviderOptions.getTokenOptions);
if (response) {
return response.token;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("TokenCredentialAuthenticationProvider.ts", () => {
}

const authProviderOptions: TokenCredentialAuthenticationProviderOptions = {
getTokenoptions: null,
getTokenOptions: null,
scopes,
};
const accessToken: AccessToken = { token: "dummy_valid_token", expiresOnTimestamp: 1 };
Expand All @@ -43,7 +43,7 @@ describe("TokenCredentialAuthenticationProvider.ts", () => {
throw new Error("Method definition for getToken is not found");
}
const authProviderOptions: TokenCredentialAuthenticationProviderOptions = {
getTokenoptions: null,
getTokenOptions: null,
scopes,
};
const accessToken: AccessToken = undefined;
Expand Down