-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Instance Discovery 2.x #1756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instance Discovery 2.x #1756
Conversation
…tion-library-for-js into msal-common-instance-discovery
…tion-library-for-js into msal-common-instance-discovery
…soft-authentication-library-for-js into msal-common-instance-discovery
import { ClientConfigurationError } from "../error/ClientConfigurationError"; | ||
|
||
export class TrustedAuthority { | ||
private static InstanceMetadata: InstanceMetadataType = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to make these static? I would rather only make functions and fields static if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things like knownAuthorities and the network interface can then be passed into the constructor and re-used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I received feedback when I implemented knownAuthorities originally that it should be static. The idea is that it's a set once variable to prevent trying to switch up your knownAuthorities mid-stream so we don't want it to be tied to an instance where we may need to rebuild it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for a couple things that we could change. Would also like to see a sample but it can be done later.
Sample showing |
@@ -14,6 +14,7 @@ export type BrowserAuthOptions = { | |||
clientId: string; | |||
authority?: string; | |||
knownAuthorities?: Array<string>; | |||
instanceMetadata?: Array<IInstanceDiscoveryMetadata>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming here might get confusing when we implement the other perf changes which introduced authorityMetadata
in msal-core. Open to suggestions for a better name here.
This reverts commit 4d35732.
This reverts commit 663e604.
This reverts commit da430bd.
This reverts commit 045acbe.
This reverts commit f939af1.
This reverts commit 27b0530.
This reverts commit ed17743.
This reverts commit 0dddb02.
…AD/microsoft-authentication-library-for-js into msal-common-instance-discovery" This reverts commit 4662361, reversing changes made to 4f15a91.
Ports #1582 into msal-common
Similar to the previous PR for msal-core this PR does several things in regards to Authorities:
preferred_cache
andpreferred_network
values used to determine which endpoint to hit and what authority to cache under. This is the only piece that differs from the msal-core implementation.Developers can opt out of the network call in one of 2 ways:
TODO:
Scheduled Refresh will be taken in future PR