Skip to content

Commit

Permalink
Merge branch 'msal-lts' into multiple-msal-rt-support
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerag authored Jul 6, 2023
2 parents 91e8ab7 + 57646b1 commit 795b84a
Show file tree
Hide file tree
Showing 50 changed files with 467 additions and 117 deletions.

This file was deleted.

15 changes: 15 additions & 0 deletions lib/msal-angular/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@azure/msal-angular",
"entries": [
{
"date": "Wed, 05 Jul 2023 22:05:09 GMT",
"tag": "@azure/msal-angular_v2.5.9",
"version": "2.5.9",
"comments": {
"patch": [
{
"author": "beachball",
"package": "@azure/msal-angular",
"comment": "Bump @azure/msal-browser to v2.38.0",
"commit": "db1d92f1ee3939a026f4923fe94812753f879264"
}
]
}
},
{
"date": "Wed, 07 Jun 2023 03:15:51 GMT",
"tag": "@azure/msal-angular_v2.5.8",
Expand Down
10 changes: 9 additions & 1 deletion lib/msal-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Change Log - @azure/msal-angular

This log was last generated on Wed, 07 Jun 2023 03:15:51 GMT and should not be manually modified.
This log was last generated on Wed, 05 Jul 2023 22:05:09 GMT and should not be manually modified.

<!-- Start content -->

## 2.5.9

Wed, 05 Jul 2023 22:05:09 GMT

### Patches

- Bump @azure/msal-browser to v2.38.0

## 2.5.8

Wed, 07 Jun 2023 03:15:51 GMT
Expand Down
36 changes: 18 additions & 18 deletions lib/msal-angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/msal-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/msal-angular",
"version": "2.5.8",
"version": "2.5.9",
"author": {
"name": "Microsoft",
"email": "[email protected]",
Expand Down Expand Up @@ -49,7 +49,7 @@
"@angular/platform-browser": "~11.2.12",
"@angular/platform-browser-dynamic": "~11.2.12",
"@angular/router": "~11.2.12",
"@azure/msal-browser": "^2.37.1",
"@azure/msal-browser": "^2.38.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
Expand All @@ -69,7 +69,7 @@
"zone.js": "~0.10.3"
},
"peerDependencies": {
"@azure/msal-browser": "^2.37.1",
"@azure/msal-browser": "^2.38.0",
"rxjs": "^6.0.0 || ^7.0.0"
}
}
2 changes: 1 addition & 1 deletion lib/msal-angular/src/packageMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* eslint-disable header/header */
export const name = "@azure/msal-angular";
export const version = "2.5.8";
export const version = "2.5.9";
21 changes: 21 additions & 0 deletions lib/msal-browser/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"name": "@azure/msal-browser",
"entries": [
{
"date": "Wed, 05 Jul 2023 22:05:09 GMT",
"tag": "@azure/msal-browser_v2.38.0",
"version": "2.38.0",
"comments": {
"minor": [
{
"author": "[email protected]",
"package": "@azure/msal-browser",
"commit": "db1d92f1ee3939a026f4923fe94812753f879264",
"comment": "Make claims-based caching configurable [LTS] #6187"
},
{
"author": "beachball",
"package": "@azure/msal-browser",
"comment": "Bump @azure/msal-common to v13.2.0",
"commit": "db1d92f1ee3939a026f4923fe94812753f879264"
}
]
}
},
{
"date": "Wed, 07 Jun 2023 03:15:51 GMT",
"tag": "@azure/msal-browser_v2.37.1",
Expand Down
11 changes: 10 additions & 1 deletion lib/msal-browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Change Log - @azure/msal-browser

This log was last generated on Wed, 07 Jun 2023 03:15:51 GMT and should not be manually modified.
This log was last generated on Wed, 05 Jul 2023 22:05:09 GMT and should not be manually modified.

<!-- Start content -->

## 2.38.0

Wed, 05 Jul 2023 22:05:09 GMT

### Minor changes

- Make claims-based caching configurable [LTS] #6187 ([email protected])
- Bump @azure/msal-common to v13.2.0

## 2.37.1

Wed, 07 Jun 2023 03:15:51 GMT
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ npm install @azure/msal-browser

<!-- CDN_LATEST -->
```html
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.37.1/js/msal-browser.min.js"></script>
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.38.0/js/msal-browser.min.js"></script>
```

See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/cdn-usage.md) for more info on how to use this package from the Microsoft CDN.
Expand Down
4 changes: 3 additions & 1 deletion lib/msal-browser/docs/cdn-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In addition to npm, `msal` can be consumed from Microsoft-hosted CDNs.

<!-- CDN_LATEST -->
```html
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.37.1/js/msal-browser.min.js"></script>
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.38.0/js/msal-browser.min.js"></script>
```

## Unminified builds
Expand Down Expand Up @@ -84,6 +84,8 @@ It is highly recommended to use SRI Hashes with CDN builds of MSAL.js to help se
<!-- SRI_TABLE_START -->
Version | Build | SRI Hash
------------ | ------------------- | ---------------------------
2.38.0 | msal-browser.js | `sha384-lgbqcLVY1nEDcnWK7TBwNPB0k+EdFUHkFgJ88TjFCKP/ipdBasieALRksCvnfj9Q`
2.38.0 | msal-browser.min.js | `sha384-mz+8Q3jA4XBFbnyAsyQegn/0LHvziH7qHLBa9GzcU3HzeWj9J16SXM5S+TsmPBy0`
2.37.1 | msal-browser.js | `sha384-ZhUtfSyylJR2w8+EWu+tPy2nwSrbe42+W11l8PHS1mCRC/una2i3qeMfjk9+f51P`
2.37.1 | msal-browser.min.js | `sha384-NWzhDi2da+GzMWIyUGu3sgmclPtsYExbv/YFAR4wGgSMq5DPqao5bZWgVuM6udHv`
2.37.0 | msal-browser.js | `sha384-5qNoaJXt3rjMzi52yZr0SzU1Zcy07l5K1Crpw4LPzfklFfdvwPuwZPbESoStBbs1`
Expand Down
4 changes: 3 additions & 1 deletion lib/msal-browser/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const msalConfig = {
cacheLocation: "sessionStorage",
temporaryCacheLocation: "sessionStorage",
storeAuthStateInCookie: false,
secureCookies: false
secureCookies: false,
claimsBasedCachingEnabled: true,
},
system: {
loggerOptions: {
Expand Down Expand Up @@ -93,6 +94,7 @@ const msalInstance = new PublicClientApplication(msalConfig);
| `storeAuthStateInCookie` | If true, stores cache items in cookies as well as browser cache. Should be set to true for use cases using IE. | boolean | `false` |
| `secureCookies` | If true and `storeAuthStateInCookies` is also enabled, MSAL adds the `Secure` flag to the browser cookie so it can only be sent over HTTPS. | boolean | `false` |
| `cacheMigrationEnabled` | If true, cache entries from older versions of MSAL will be updated to conform to the latest cache schema on startup. If your application has not been recently updated to a new version of MSAL.js you can safely turn this off. In the event old cache entries are not migrated it may result in a cache miss when attempting to retrieve accounts or tokens and affected users may need to re-authenticate to get up to date. | boolean | `true` when using `localStorage`, `false` otherwise |
| `claimsBasedCachingEnabled` | If `true`, access tokens will be cached under a key containing the hash of the requested claims string, resulting in a cache miss and new network token request when the same token request is made with different or missing claims. If set to `false`, tokens will be cached without claims, but all requests containing claims will go to the network and overwrite any previously cached token with the same scopes. | boolean | `true` |

See [Caching in MSAL](./caching.md) for more.

Expand Down
18 changes: 9 additions & 9 deletions lib/msal-browser/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/msal-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "git",
"url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
},
"version": "2.37.1",
"version": "2.38.0",
"description": "Microsoft Authentication Library for js",
"keywords": [
"implicit",
Expand Down Expand Up @@ -90,6 +90,6 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@azure/msal-common": "13.1.0"
"@azure/msal-common": "13.2.0"
}
}
3 changes: 2 additions & 1 deletion lib/msal-browser/src/app/ClientApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ export abstract class ClientApplication {
temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
storeAuthStateInCookie: false,
secureCookies: false,
cacheMigrationEnabled: false
cacheMigrationEnabled: false,
claimsBasedCachingEnabled: true
};
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);

Expand Down
3 changes: 2 additions & 1 deletion lib/msal-browser/src/cache/BrowserCacheManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,8 @@ export const DEFAULT_BROWSER_CACHE_MANAGER = (clientId: string, logger: Logger):
temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
storeAuthStateInCookie: false,
secureCookies: false,
cacheMigrationEnabled: false
cacheMigrationEnabled: false,
claimsBasedCachingEnabled: true
};
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
};
7 changes: 6 additions & 1 deletion lib/msal-browser/src/config/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export type CacheOptions = {
* If set, MSAL will attempt to migrate cache entries from older versions on initialization. By default this flag is set to true if cacheLocation is localStorage, otherwise false.
*/
cacheMigrationEnabled?: boolean;
/**
* Flag that determines whether access tokens are stored based on requested claims
*/
claimsBasedCachingEnabled?: boolean;
};

export type BrowserSystemOptions = SystemOptions & {
Expand Down Expand Up @@ -252,7 +256,8 @@ export function buildConfiguration({ auth: userInputAuth, cache: userInputCache,
storeAuthStateInCookie: false,
secureCookies: false,
// Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage
cacheMigrationEnabled: userInputCache && userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage ? true : false
cacheMigrationEnabled: userInputCache && userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage ? true : false,
claimsBasedCachingEnabled: true
};

// Default logger options for browser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export abstract class BaseInteractionClient {
this.logger.verbose(`Authentication Scheme set to "${validatedRequest.authenticationScheme}" as configured in Auth request`);
}

// Set requested claims hash if claims were requested
if (request.claims && !StringUtils.isEmpty(request.claims)) {
// Set requested claims hash if claims were requested and claims-based caching is enabled
if (this.config.cache.claimsBasedCachingEnabled && request.claims && !StringUtils.isEmptyObj(request.claims)) {
validatedRequest.requestedClaimsHash = await this.browserCrypto.hashString(request.claims);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ export abstract class StandardInteractionClient extends BaseInteractionClient {
logLevel: logger.logLevel,
correlationId: this.correlationId
},
cacheOptions: {
claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled
},
cryptoInterface: this.browserCrypto,
networkInterface: this.networkClient,
storageInterface: this.browserStorage,
Expand Down
2 changes: 1 addition & 1 deletion lib/msal-browser/src/packageMetadata.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* eslint-disable header/header */
export const name = "@azure/msal-browser";
export const version = "2.37.1";
export const version = "2.38.0";
3 changes: 2 additions & 1 deletion lib/msal-browser/test/app/PublicClientApplication.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const cacheConfig = {
cacheLocation: BrowserCacheLocation.SessionStorage,
storeAuthStateInCookie: false,
secureCookies: false,
cacheMigrationEnabled: false
cacheMigrationEnabled: false,
claimsBasedCachingEnabled: true
};

let testAppConfig = {
Expand Down
Loading

0 comments on commit 795b84a

Please sign in to comment.