@azure/msal-common
Advanced tools
Comparing version 1.7.2 to 2.0.0
@@ -5,2 +5,95 @@ { | ||
{ | ||
"date": "Mon, 07 Dec 2020 22:19:03 GMT", | ||
"tag": "@azure/msal-common_v2.0.0", | ||
"version": "2.0.0", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Fix login loop with empty query string (#2707)", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "307307edb3d9877caca3874d17f35faf2bae6180", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Expose idTokenClaims on AccountInfo (#2554)", | ||
"author": "janutter@microsoft.com", | ||
"commit": "cb2165aad7995d904ec49ade565d907dc314ce16", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Add matchPattern string util for wildcard matching for urls (#2678)", | ||
"author": "janutter@microsoft.com", | ||
"commit": "4642741f3def4cdb575cc0a228f88e19f84e3da5", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "fix: added missing async (AzureAD/microsoft-authentication-library-for-js#2652)", | ||
"author": "patrick@ruhkopf.me", | ||
"commit": "1c0df2fc1468fb094c76da04de91271ffb4461c7", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Log messages contain package name and version (#2589)", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "4568c16bd425e242cdb799ec59b3508654cc2e45", | ||
"package": "@azure/msal-common" | ||
} | ||
], | ||
"minor": [ | ||
{ | ||
"comment": "Add clone to Logger (#2670)", | ||
"author": "joarroyo@microsoft.com", | ||
"commit": "9efb3ba5886eaf6f3a3cd36957ab9fcb7399278a", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Enable the instance_aware flow (#1804)", | ||
"author": "prkanher@microsoft.com", | ||
"commit": "3e616e162149f4e57257b70e6d481c4596d91ef9", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Support id_token_hint on logout request (#2587)", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "fa9b7009f094b3c17a6d177fcec9b736320735c0", | ||
"package": "@azure/msal-common" | ||
} | ||
], | ||
"major": [ | ||
{ | ||
"comment": "Enable StrictNullChecks (#2602)", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "ebf18c6daead16f8cfd2afb3b63cbd59fc63046a", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Rename request types and change required fields (#2512)", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "5b891222d674eb5664af9187f319a61b50341f55", | ||
"package": "@azure/msal-common" | ||
} | ||
], | ||
"none": [ | ||
{ | ||
"comment": "Enforce triple equals in eslint", | ||
"author": "janutter@microsoft.com", | ||
"commit": "5975eb4077a2b4372683e68af4d748b0808134ab", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Package-lock update", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "9c029bc074ecd32483a45cfab8721f0771c31e55", | ||
"package": "@azure/msal-common" | ||
}, | ||
{ | ||
"comment": "Remove console.log in unit tests (#2629)", | ||
"author": "thomas.norling@microsoft.com", | ||
"commit": "b89d8029a3703b2bfa1f9399456e652fe6f26e4f", | ||
"package": "@azure/msal-common" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Wed, 11 Nov 2020 23:33:20 GMT", | ||
@@ -7,0 +100,0 @@ "tag": "@azure/msal-common_v1.7.2", |
# Change Log - @azure/msal-common | ||
This log was last generated on Wed, 11 Nov 2020 23:33:20 GMT and should not be manually modified. | ||
This log was last generated on Mon, 07 Dec 2020 22:19:03 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 2.0.0 | ||
Mon, 07 Dec 2020 22:19:03 GMT | ||
### Major changes | ||
- Enable StrictNullChecks (#2602) (thomas.norling@microsoft.com) | ||
- Rename request types and change required fields (#2512) (thomas.norling@microsoft.com) | ||
### Minor changes | ||
- Add clone to Logger (#2670) (joarroyo@microsoft.com) | ||
- Enable the instance_aware flow (#1804) (prkanher@microsoft.com) | ||
- Support id_token_hint on logout request (#2587) (thomas.norling@microsoft.com) | ||
### Patches | ||
- Fix login loop with empty query string (#2707) (thomas.norling@microsoft.com) | ||
- Expose idTokenClaims on AccountInfo (#2554) (janutter@microsoft.com) | ||
- Add matchPattern string util for wildcard matching for urls (#2678) (janutter@microsoft.com) | ||
- fix: added missing async (AzureAD/microsoft-authentication-library-for-js#2652) (patrick@ruhkopf.me) | ||
- Log messages contain package name and version (#2589) (thomas.norling@microsoft.com) | ||
## 1.7.2 | ||
@@ -8,0 +31,0 @@ |
@@ -9,2 +9,4 @@ /** | ||
* - name - Full name for the account, including given name and family name | ||
* - idTokenClaims - Object contains claims from ID token | ||
* - localAccountId - The user's account ID | ||
*/ | ||
@@ -18,2 +20,3 @@ export declare type AccountInfo = { | ||
name?: string; | ||
idTokenClaims?: object; | ||
}; |
@@ -72,3 +72,5 @@ import { AuthorityType } from "./AuthorityType"; | ||
private discoverEndpoints; | ||
private get aadInstanceDiscoveryEndpointUrl(); | ||
/** | ||
* Set the trusted hosts and validate subsequent calls | ||
*/ | ||
private validateAndSetPreferredNetwork; | ||
@@ -80,2 +82,7 @@ /** | ||
/** | ||
* Determine if given hostname is alias of this authority | ||
* @param host | ||
*/ | ||
isAuthorityAlias(host: string): boolean; | ||
/** | ||
* helper function to generate environment from authority object | ||
@@ -82,0 +89,0 @@ * @param authority |
@@ -14,2 +14,3 @@ import { AccountCache, AccountFilter, CredentialFilter, CredentialCache, AppMetadataFilter, AppMetadataCache } from "./utils/CacheTypes"; | ||
import { ThrottlingEntity } from "./entities/ThrottlingEntity"; | ||
import { ICrypto } from "../crypto/ICrypto"; | ||
/** | ||
@@ -19,2 +20,5 @@ * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens. | ||
export declare abstract class CacheManager implements ICacheManager { | ||
protected clientId: string; | ||
protected cryptoImpl: ICrypto; | ||
constructor(clientId: string, cryptoImpl: ICrypto); | ||
/** | ||
@@ -232,3 +236,3 @@ * fetch the account entity from the platform cache | ||
*/ | ||
readAppMetadataFromCache(environment: string, clientId: string): AppMetadataEntity; | ||
readAppMetadataFromCache(environment: string, clientId: string): AppMetadataEntity | null; | ||
/** | ||
@@ -235,0 +239,0 @@ * Return the family_id value associated with FOCI |
@@ -7,2 +7,3 @@ import { Authority } from "../../authority/Authority"; | ||
import { Logger } from "../../logger/Logger"; | ||
import { TokenClaims } from "../../account/TokenClaims"; | ||
/** | ||
@@ -28,2 +29,3 @@ * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs). | ||
* oboAssertion: access token passed in as part of OBO request | ||
* idTokenClaims: Object containing claims parsed from ID token | ||
* } | ||
@@ -43,2 +45,5 @@ */ | ||
oboAssertion?: string; | ||
cloudGraphHostName?: string; | ||
msGraphHost?: string; | ||
idTokenClaims?: TokenClaims; | ||
/** | ||
@@ -72,3 +77,3 @@ * Generate Account Id key component as per the schema: <home_account_id>-<environment> | ||
*/ | ||
static createAccount(clientInfo: string, homeAccountId: string, authority: Authority, idToken: AuthToken, oboAssertion?: string): AccountEntity; | ||
static createAccount(clientInfo: string, homeAccountId: string, authority: Authority, idToken: AuthToken, oboAssertion?: string, cloudGraphHostName?: string, msGraphHost?: string): AccountEntity; | ||
/** | ||
@@ -79,3 +84,3 @@ * Builds non-AAD/ADFS account. | ||
*/ | ||
static createGenericAccount(authority: Authority, homeAccountId: string, idToken: AuthToken, oboAssertion?: string): AccountEntity; | ||
static createGenericAccount(authority: Authority, homeAccountId: string, idToken: AuthToken, oboAssertion?: string, cloudGraphHostName?: string, msGraphHost?: string): AccountEntity; | ||
/** | ||
@@ -82,0 +87,0 @@ * Generate HomeAccountId from server response |
@@ -7,8 +7,8 @@ import { IdTokenEntity } from "./IdTokenEntity"; | ||
export declare class CacheRecord { | ||
account: AccountEntity; | ||
idToken: IdTokenEntity; | ||
accessToken: AccessTokenEntity; | ||
refreshToken: RefreshTokenEntity; | ||
appMetadata: AppMetadataEntity; | ||
constructor(accountEntity?: AccountEntity, idTokenEntity?: IdTokenEntity, accessTokenEntity?: AccessTokenEntity, refreshTokenEntity?: RefreshTokenEntity, appMetadataEntity?: AppMetadataEntity); | ||
account: AccountEntity | null; | ||
idToken: IdTokenEntity | null; | ||
accessToken: AccessTokenEntity | null; | ||
refreshToken: RefreshTokenEntity | null; | ||
appMetadata: AppMetadataEntity | null; | ||
constructor(accountEntity?: AccountEntity | null, idTokenEntity?: IdTokenEntity | null, accessTokenEntity?: AccessTokenEntity | null, refreshTokenEntity?: RefreshTokenEntity | null, appMetadataEntity?: AppMetadataEntity | null); | ||
} |
@@ -7,2 +7,3 @@ import { BaseClient } from "./BaseClient"; | ||
import { EndSessionRequest } from "../request/EndSessionRequest"; | ||
import { AuthorizationCodePayload } from "../response/AuthorizationCodePayload"; | ||
/** | ||
@@ -29,3 +30,3 @@ * Oauth2.0 Authorization Code client | ||
*/ | ||
acquireToken(request: AuthorizationCodeRequest, cachedNonce?: string, cachedState?: string): Promise<AuthenticationResult>; | ||
acquireToken(request: AuthorizationCodeRequest, authCodePayload?: AuthorizationCodePayload): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -36,3 +37,3 @@ * Handles the hash fragment response from public client code request. Returns a code response used by | ||
*/ | ||
handleFragmentResponse(hashFragment: string, cachedState: string): string; | ||
handleFragmentResponse(hashFragment: string, cachedState: string): AuthorizationCodePayload; | ||
/** | ||
@@ -60,2 +61,7 @@ * Use to log out the current user, and redirect the user to the postLogoutRedirectUri. | ||
private createAuthCodeUrlQueryString; | ||
/** | ||
* This API validates the `EndSessionRequest` and creates a URL | ||
* @param request | ||
*/ | ||
private createLogoutUrlQueryString; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ClientConfiguration } from "../config/ClientConfiguration"; | ||
import { ClientConfiguration, CommonClientConfiguration } from "../config/ClientConfiguration"; | ||
import { INetworkModule } from "../network/INetworkModule"; | ||
@@ -16,9 +16,9 @@ import { NetworkManager, NetworkResponse } from "../network/NetworkManager"; | ||
logger: Logger; | ||
protected config: ClientConfiguration; | ||
protected config: CommonClientConfiguration; | ||
protected cryptoUtils: ICrypto; | ||
protected cacheManager: CacheManager; | ||
protected networkClient: INetworkModule; | ||
protected serverTelemetryManager: ServerTelemetryManager; | ||
protected serverTelemetryManager: ServerTelemetryManager | null; | ||
protected networkManager: NetworkManager; | ||
protected authority: Authority; | ||
authority: Authority; | ||
protected constructor(configuration: ClientConfiguration); | ||
@@ -41,2 +41,7 @@ /** | ||
protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record<string, string>, thumbprint: RequestThumbprint): Promise<NetworkResponse<ServerAuthorizationTokenResponse>>; | ||
/** | ||
* Updates the authority object of the client. Endpoint discovery must be completed. | ||
* @param updatedAuthority | ||
*/ | ||
updateAuthority(updatedAuthority: Authority): void; | ||
} |
@@ -11,7 +11,27 @@ import { ClientConfiguration } from "../config/ClientConfiguration"; | ||
constructor(configuration: ClientConfiguration); | ||
acquireToken(request: ClientCredentialRequest): Promise<AuthenticationResult>; | ||
/** | ||
* Public API to acquire a token with ClientCredential Flow for Confidential clients | ||
* @param request | ||
*/ | ||
acquireToken(request: ClientCredentialRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
* looks up cache if the tokens are cached already | ||
*/ | ||
private getCachedAuthenticationResult; | ||
/** | ||
* Reads access token from the cache | ||
* TODO: Move this call to cacheManager instead | ||
*/ | ||
private readAccessTokenFromCache; | ||
/** | ||
* Makes a network call to request the token from the service | ||
* @param request | ||
* @param authority | ||
*/ | ||
private executeTokenRequest; | ||
/** | ||
* generate the request to the server in the acceptable format | ||
* @param request | ||
*/ | ||
private createTokenRequestBody; | ||
} |
@@ -15,3 +15,3 @@ import { BaseClient } from "./BaseClient"; | ||
*/ | ||
acquireToken(request: DeviceCodeRequest): Promise<AuthenticationResult>; | ||
acquireToken(request: DeviceCodeRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -18,0 +18,0 @@ * Creates device code request and executes http GET |
@@ -11,9 +11,38 @@ import { ClientConfiguration } from "../config/ClientConfiguration"; | ||
constructor(configuration: ClientConfiguration); | ||
acquireToken(request: OnBehalfOfRequest): Promise<AuthenticationResult>; | ||
/** | ||
* Public API to acquire tokens with on behalf of flow | ||
* @param request | ||
*/ | ||
acquireToken(request: OnBehalfOfRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
* look up cache for tokens | ||
* @param request | ||
*/ | ||
private getCachedAuthenticationResult; | ||
/** | ||
* read access token from cache TODO: CacheManager API should be used here | ||
* @param request | ||
*/ | ||
private readAccessTokenFromCache; | ||
/** | ||
* read idtoken from cache TODO: CacheManager API should be used here instead | ||
* @param request | ||
*/ | ||
private readIdTokenFromCache; | ||
/** | ||
* read account from cache, TODO: CacheManager API should be used here instead | ||
* @param account | ||
*/ | ||
private readAccountFromCache; | ||
/** | ||
* Make a network call to the server requesting credentials | ||
* @param request | ||
* @param authority | ||
*/ | ||
private executeTokenRequest; | ||
/** | ||
* generate a server request in accepable format | ||
* @param request | ||
*/ | ||
private createTokenRequestBody; | ||
} |
@@ -11,3 +11,3 @@ import { ClientConfiguration } from "../config/ClientConfiguration"; | ||
constructor(configuration: ClientConfiguration); | ||
acquireToken(request: RefreshTokenRequest): Promise<AuthenticationResult>; | ||
acquireToken(request: RefreshTokenRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -17,3 +17,3 @@ * Gets cached refresh token and attaches to request, then calls acquireToken API | ||
*/ | ||
acquireTokenByRefreshToken(request: SilentFlowRequest): Promise<AuthenticationResult>; | ||
acquireTokenByRefreshToken(request: SilentFlowRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -20,0 +20,0 @@ * makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached |
@@ -12,3 +12,3 @@ import { BaseClient } from "./BaseClient"; | ||
*/ | ||
acquireToken(request: SilentFlowRequest): Promise<AuthenticationResult>; | ||
acquireToken(request: SilentFlowRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -15,0 +15,0 @@ * Retrieves token from cache or throws an error if it must be refreshed. |
@@ -16,3 +16,3 @@ import { BaseClient } from "./BaseClient"; | ||
*/ | ||
acquireToken(request: UsernamePasswordRequest): Promise<AuthenticationResult>; | ||
acquireToken(request: UsernamePasswordRequest): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -19,0 +19,0 @@ * Executes POST request to token endpoint |
@@ -32,6 +32,19 @@ import { INetworkModule } from "../network/INetworkModule"; | ||
libraryInfo?: LibraryInfo; | ||
serverTelemetryManager?: ServerTelemetryManager; | ||
persistencePlugin?: ICachePlugin; | ||
serializableCache?: ISerializableTokenCache; | ||
serverTelemetryManager?: ServerTelemetryManager | null; | ||
persistencePlugin?: ICachePlugin | null; | ||
serializableCache?: ISerializableTokenCache | null; | ||
}; | ||
export declare type CommonClientConfiguration = { | ||
authOptions: Required<AuthOptions>; | ||
systemOptions: Required<SystemOptions>; | ||
loggerOptions: Required<LoggerOptions>; | ||
storageInterface: CacheManager; | ||
networkInterface: INetworkModule; | ||
cryptoInterface: Required<ICrypto>; | ||
libraryInfo: LibraryInfo; | ||
serverTelemetryManager: ServerTelemetryManager | null; | ||
clientCredentials: ClientCredentials; | ||
persistencePlugin: ICachePlugin | null; | ||
serializableCache: ISerializableTokenCache | null; | ||
}; | ||
/** | ||
@@ -49,3 +62,3 @@ * Use this to configure the auth options in the ClientConfiguration object | ||
clientId: string; | ||
authority?: Authority; | ||
authority: Authority; | ||
knownAuthorities?: Array<string>; | ||
@@ -95,3 +108,3 @@ cloudDiscoveryMetadata?: string; | ||
}; | ||
export declare const DEFAULT_SYSTEM_OPTIONS: SystemOptions; | ||
export declare const DEFAULT_SYSTEM_OPTIONS: Required<SystemOptions>; | ||
/** | ||
@@ -104,2 +117,2 @@ * Function that sets the default options when not explicitly configured from app developer | ||
*/ | ||
export declare function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache }: ClientConfiguration): ClientConfiguration; | ||
export declare function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache }: ClientConfiguration): CommonClientConfiguration; |
@@ -16,4 +16,4 @@ /** | ||
errorMessage: string; | ||
suberror: string; | ||
constructor(errorCode: string, errorMessage?: string, suberror?: string); | ||
subError: string; | ||
constructor(errorCode?: string, errorMessage?: string, suberror?: string); | ||
/** | ||
@@ -20,0 +20,0 @@ * Creates an error that is thrown when something unexpected happens in the library. |
@@ -43,2 +43,6 @@ import { AuthError } from "./AuthError"; | ||
}; | ||
stateNotFoundError: { | ||
code: string; | ||
desc: string; | ||
}; | ||
nonceMismatchError: { | ||
@@ -48,2 +52,6 @@ code: string; | ||
}; | ||
nonceNotFoundError: { | ||
code: string; | ||
desc: string; | ||
}; | ||
noTokensFoundError: { | ||
@@ -141,2 +149,10 @@ code: string; | ||
}; | ||
tokenClaimsRequired: { | ||
code: string; | ||
desc: string; | ||
}; | ||
noAuthorizationCodeFromServer: { | ||
code: string; | ||
desc: string; | ||
}; | ||
}; | ||
@@ -157,3 +173,3 @@ /** | ||
*/ | ||
static createClientInfoEmptyError(rawClientInfo: string): ClientAuthError; | ||
static createClientInfoEmptyError(): ClientAuthError; | ||
/** | ||
@@ -188,2 +204,7 @@ * Creates an error thrown when the id token extraction errors out. | ||
/** | ||
* Creates an error thrown when the state is not present | ||
* @param missingState | ||
*/ | ||
static createStateNotFoundError(missingState: string): ClientAuthError; | ||
/** | ||
* Creates an error thrown when the nonce does not match. | ||
@@ -193,2 +214,7 @@ */ | ||
/** | ||
* Creates an error thrown when the mnonce is not present | ||
* @param missingNonce | ||
*/ | ||
static createNonceNotFoundError(missingNonce: string): ClientAuthError; | ||
/** | ||
* Creates an error thrown when the authorization code required for a token request is null or empty. | ||
@@ -290,2 +316,10 @@ */ | ||
static createRefreshRequiredError(): ClientAuthError; | ||
/** | ||
* Throws error if token claims are not populated for a signed jwt generation | ||
*/ | ||
static createTokenClaimsRequiredError(): ClientAuthError; | ||
/** | ||
* Throws error when the authorization code is missing from the server response | ||
*/ | ||
static createNoAuthCodeInServerResponseError(): ClientAuthError; | ||
} |
@@ -78,2 +78,6 @@ import { ClientAuthError } from "./ClientAuthError"; | ||
}; | ||
resourceRequestParametersRequired: { | ||
code: string; | ||
desc: string; | ||
}; | ||
}; | ||
@@ -164,2 +168,6 @@ /** | ||
static createUntrustedAuthorityError(): ClientConfigurationError; | ||
/** | ||
* Throws error when resourceRequestMethod or resourceRequestUri is missing | ||
*/ | ||
static createResourceRequestParametersRequiredError(): ClientConfigurationError; | ||
} |
@@ -11,4 +11,4 @@ import { ServerError } from "./ServerError"; | ||
export declare class InteractionRequiredAuthError extends ServerError { | ||
constructor(errorCode: string, errorMessage?: string, subError?: string); | ||
static isInteractionRequiredError(errorCode: string, errorString: string, subError?: string): boolean; | ||
constructor(errorCode?: string, errorMessage?: string, subError?: string); | ||
static isInteractionRequiredError(errorCode?: string, errorString?: string, subError?: string): boolean; | ||
} |
@@ -6,4 +6,3 @@ import { AuthError } from "./AuthError"; | ||
export declare class ServerError extends AuthError { | ||
subError: string; | ||
constructor(errorCode: string, errorMessage?: string, subError?: string); | ||
constructor(errorCode?: string, errorMessage?: string, subError?: string); | ||
} |
@@ -53,3 +53,5 @@ export { AuthorizationCodeClient } from "./client/AuthorizationCodeClient"; | ||
export { AuthenticationResult } from "./response/AuthenticationResult"; | ||
export { AuthorizationCodePayload } from "./response/AuthorizationCodePayload"; | ||
export { ServerAuthorizationCodeResponse } from "./response/ServerAuthorizationCodeResponse"; | ||
export { DeviceCodeResponse } from "./response/DeviceCodeResponse"; | ||
export { ILoggerCallback, LogLevel, Logger } from "./logger/Logger"; | ||
@@ -56,0 +58,0 @@ export { InteractionRequiredAuthError } from "./error/InteractionRequiredAuthError"; |
@@ -34,4 +34,10 @@ import { LoggerOptions } from "../config/ClientConfiguration"; | ||
private localCallback; | ||
constructor(loggerOptions: LoggerOptions); | ||
private packageName; | ||
private packageVersion; | ||
constructor(loggerOptions: LoggerOptions, packageName?: string, packageVersion?: string); | ||
/** | ||
* Create new Logger with existing configurations. | ||
*/ | ||
clone(packageName: string, packageVersion: string): Logger; | ||
/** | ||
* Log message with required options. | ||
@@ -38,0 +44,0 @@ */ |
@@ -18,6 +18,6 @@ import { BaseAuthRequest } from "./BaseAuthRequest"; | ||
export declare type AuthorizationCodeRequest = BaseAuthRequest & { | ||
authenticationScheme: AuthenticationScheme; | ||
code: string; | ||
redirectUri: string; | ||
code: string; | ||
codeVerifier?: string; | ||
authenticationScheme?: AuthenticationScheme; | ||
}; |
@@ -34,16 +34,16 @@ import { ResponseMode, AuthenticationScheme } from "../utils/Constants"; | ||
export declare type AuthorizationUrlRequest = BaseAuthRequest & { | ||
authenticationScheme?: AuthenticationScheme; | ||
redirectUri?: string; | ||
extraScopesToConsent?: Array<string>; | ||
responseMode?: ResponseMode; | ||
authenticationScheme: AuthenticationScheme; | ||
redirectUri: string; | ||
responseMode: ResponseMode; | ||
account?: AccountInfo; | ||
codeChallenge?: string; | ||
codeChallengeMethod?: string; | ||
state?: string; | ||
prompt?: string; | ||
account?: AccountInfo; | ||
loginHint?: string; | ||
domainHint?: string; | ||
sid?: string; | ||
extraQueryParameters?: StringDict; | ||
extraScopesToConsent?: Array<string>; | ||
loginHint?: string; | ||
nonce?: string; | ||
prompt?: string; | ||
sid?: string; | ||
state?: string; | ||
}; |
@@ -11,8 +11,8 @@ /** | ||
export declare type BaseAuthRequest = { | ||
authority: string; | ||
correlationId: string; | ||
scopes: Array<string>; | ||
claims?: string; | ||
authority?: string; | ||
correlationId?: string; | ||
resourceRequestMethod?: string; | ||
resourceRequestUri?: string; | ||
}; |
import { BaseAuthRequest } from "./BaseAuthRequest"; | ||
/** | ||
* RefreshTokenRequest | ||
* ClientCredentialRequest | ||
* - scopes - Array of scopes the application is requesting access to. | ||
@@ -5,0 +5,0 @@ * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. |
@@ -6,10 +6,10 @@ import { AccountInfo } from "../account/AccountInfo"; | ||
* - postLogoutRedirectUri - URI to navigate to after logout page. | ||
* - authority - Authority to send logout request to. | ||
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes. | ||
* - idTokenHint - ID Token used by B2C to validate logout if required by the policy | ||
*/ | ||
export declare type EndSessionRequest = { | ||
correlationId: string; | ||
account?: AccountInfo; | ||
postLogoutRedirectUri?: string; | ||
authority?: string; | ||
correlationId?: string; | ||
idTokenHint?: string; | ||
}; |
@@ -15,3 +15,3 @@ import { BaseAuthRequest } from "./BaseAuthRequest"; | ||
refreshToken: string; | ||
authenticationScheme?: AuthenticationScheme; | ||
authenticationScheme: AuthenticationScheme; | ||
}; |
@@ -33,2 +33,12 @@ import { ResponseMode } from "../utils/Constants"; | ||
/** | ||
* add post logout redirectUri | ||
* @param redirectUri | ||
*/ | ||
addPostLogoutRedirectUri(redirectUri: string): void; | ||
/** | ||
* add id_token_hint to logout request | ||
* @param idTokenHint | ||
*/ | ||
addIdTokenHint(idTokenHint: string): void; | ||
/** | ||
* add domain_hint | ||
@@ -52,3 +62,3 @@ * @param domainHint | ||
*/ | ||
addClaims(claims: string, clientCapabilities: Array<string>): void; | ||
addClaims(claims?: string, clientCapabilities?: Array<string>): void; | ||
/** | ||
@@ -146,3 +156,3 @@ * add correlationId | ||
addExtraQueryParameters(eQparams: StringDict): void; | ||
addClientCapabilitiesToClaims(claims: string, clientCapabilities: Array<string>): string; | ||
addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string; | ||
/** | ||
@@ -149,0 +159,0 @@ * adds `username` for Password Grant flow |
@@ -16,3 +16,3 @@ import { AccountInfo } from "../account/AccountInfo"; | ||
account: AccountInfo; | ||
forceRefresh?: boolean; | ||
forceRefresh: boolean; | ||
}; |
@@ -18,6 +18,7 @@ import { AccountInfo } from "../account/AccountInfo"; | ||
export declare type AuthenticationResult = { | ||
authority: string; | ||
uniqueId: string; | ||
tenantId: string; | ||
scopes: Array<string>; | ||
account: AccountInfo; | ||
account: AccountInfo | null; | ||
idToken: string; | ||
@@ -27,3 +28,3 @@ idTokenClaims: object; | ||
fromCache: boolean; | ||
expiresOn: Date; | ||
expiresOn: Date | null; | ||
tokenType: string; | ||
@@ -33,2 +34,4 @@ extExpiresOn?: Date; | ||
familyId?: string; | ||
cloudGraphHostName?: string; | ||
msGraphHost?: string; | ||
}; |
@@ -13,2 +13,3 @@ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResponse"; | ||
import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache"; | ||
import { AuthorizationCodePayload } from "./AuthorizationCodePayload"; | ||
/** | ||
@@ -25,3 +26,3 @@ * Class that handles response parsing. | ||
private persistencePlugin; | ||
constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache?: ISerializableTokenCache, persistencePlugin?: ICachePlugin); | ||
constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null); | ||
/** | ||
@@ -44,3 +45,3 @@ * Function which validates server authorization code response. | ||
*/ | ||
handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, resourceRequestMethod?: string, resourceRequestUri?: string, cachedNonce?: string, cachedState?: string, requestScopes?: string[], oboAssertion?: string, handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult>; | ||
handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, resourceRequestMethod?: string, resourceRequestUri?: string, authCodePayload?: AuthorizationCodePayload, requestScopes?: string[], oboAssertion?: string, handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult | null>; | ||
/** | ||
@@ -70,3 +71,3 @@ * Generates CacheRecord | ||
*/ | ||
static generateAuthenticationResult(cryptoObj: ICrypto, cacheRecord: CacheRecord, idTokenObj: AuthToken, fromTokenCache: boolean, requestState?: RequestStateObject, resourceRequestMethod?: string, resourceRequestUri?: string): Promise<AuthenticationResult>; | ||
static generateAuthenticationResult(cryptoObj: ICrypto, authority: Authority, cacheRecord: CacheRecord, fromTokenCache: boolean, idTokenObj?: AuthToken, requestState?: RequestStateObject, resourceRequestMethod?: string, resourceRequestUri?: string): Promise<AuthenticationResult>; | ||
} |
@@ -13,2 +13,6 @@ /** | ||
state?: string; | ||
cloud_instance_name?: string; | ||
cloud_instance_host_name?: string; | ||
cloud_graph_host_name?: string; | ||
msgraph_host?: string; | ||
error?: string; | ||
@@ -15,0 +19,0 @@ error_description?: string; |
@@ -88,2 +88,3 @@ export declare const Constants: { | ||
POST_LOGOUT_URI = "post_logout_redirect_uri", | ||
ID_TOKEN_HINT = "id_token_hint", | ||
DEVICE_CODE = "device_code", | ||
@@ -90,0 +91,0 @@ CLIENT_SECRET = "client_secret", |
@@ -17,3 +17,3 @@ import { DecodedAuthToken } from "../account/DecodedAuthToken"; | ||
*/ | ||
static isEmpty(str: string): boolean; | ||
static isEmpty(str?: string): boolean; | ||
static startsWith(str: string, search: string): boolean; | ||
@@ -42,3 +42,9 @@ static endsWith(str: string, search: string): boolean; | ||
*/ | ||
static jsonParseHelper<T>(str: string): T; | ||
static jsonParseHelper<T>(str: string): T | null; | ||
/** | ||
* Tests if a given string matches a given pattern, with support for wildcards. | ||
* @param pattern Wildcard pattern to string match. Supports "*" for wildcards | ||
* @param input String to match against | ||
*/ | ||
static matchPattern(pattern: string, input: string): boolean; | ||
} |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "1.7.2", | ||
"version": "2.0.0", | ||
"description": "Microsoft Authentication Library for js", | ||
@@ -16,0 +16,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1821468
86
20320