@@ -55,127 +55,12 @@ public ConfidentialClientApplicationOptions ConfidentialClientApplicationOptions
5555 // This is for supporting for CIAM authorities including custom url domains, see https://github.com/AzureAD/microsoft-identity-web/issues/2690
5656 internal bool PreserveAuthority { get ; set ; }
5757
58- internal MergedOptions ( )
59- {
60-
61- }
62-
63- internal MergedOptions ( MergedOptions other )
64- {
65- _confidentialClientApplicationOptions = other . _confidentialClientApplicationOptions ;
66- AadAuthorityAudience = other . AadAuthorityAudience ;
67- AppHomeTenantId = other . AppHomeTenantId ;
68- AzureCloudInstance = other . AzureCloudInstance ;
69- AzureRegion = other . AzureRegion ;
70- ClientCapabilities = other . ClientCapabilities ? . ToList ( ) ;
71- ClientName = other . ClientName ;
72- ClientVersion = other . ClientVersion ;
73- Component = other . Component ;
74- EnablePiiLogging = other . EnablePiiLogging ;
75- IsDefaultPlatformLoggingEnabled = other . IsDefaultPlatformLoggingEnabled ;
76- LogLevel = other . LogLevel ;
77- RedirectUri = other . RedirectUri ;
78- EnableCacheSynchronization = other . EnableCacheSynchronization ;
79- MergedWithCca = other . MergedWithCca ;
80- PreserveAuthority = other . PreserveAuthority ;
81-
82- // Copy properties from MicrosoftIdentityOptions
83- Instance = other . Instance ;
84- TenantId = other . TenantId ;
85- Domain = other . Domain ;
86- EditProfilePolicyId = other . EditProfilePolicyId ;
87- SignUpSignInPolicyId = other . SignUpSignInPolicyId ;
88- ResetPasswordPolicyId = other . ResetPasswordPolicyId ;
89- LegacyCacheCompatibilityEnabled = other . LegacyCacheCompatibilityEnabled ;
90- ClientCertificates = other . ClientCertificates ? . ToList ( ) ;
91- TokenDecryptionCertificates = other . TokenDecryptionCertificates ? . ToList ( ) ;
92- ClientCredentials = other . ClientCredentials ? . ToList ( ) ;
93- TokenDecryptionCredentials = other . TokenDecryptionCredentials ? . ToList ( ) ;
94- SendX5C = other . SendX5C ;
95- WithSpaAuthCode = other . WithSpaAuthCode ;
96- AllowWebApiToBeAuthorizedByACL = other . AllowWebApiToBeAuthorizedByACL ;
97- UserAssignedManagedIdentityClientId = other . UserAssignedManagedIdentityClientId ;
98- ClientCredentialsUsingManagedIdentity = other . ClientCredentialsUsingManagedIdentity ;
99- ResetPasswordPath = other . ResetPasswordPath ;
100- ErrorPath = other . ErrorPath ;
101- ExtraQueryParameters = other . ExtraQueryParameters ? . ToDictionary ( entry => entry . Key , entry => entry . Value ) ;
58+ /// <summary>
59+ /// Id Web will modify the instance so that it can be used by MSAL.
60+ /// This modifies this property so that the original value is not changed.
61+ /// </summary>
62+ internal string ? PreparedInstance { get ; set ; }
10263
103- #if ! NETSTANDARD2_0 && ! NETFRAMEWORK
104- // OpenIdConnectOptions
105- Authority = other . Authority ;
106- ClientId = other . ClientId ;
107- ClientSecret = other . ClientSecret ;
108- Configuration = other . Configuration ;
109- ConfigurationManager = other . ConfigurationManager ;
110- GetClaimsFromUserInfoEndpoint = other . GetClaimsFromUserInfoEndpoint ;
111- RequireHttpsMetadata = other . RequireHttpsMetadata ;
112- MetadataAddress = other . MetadataAddress ;
113- Events = other . Events ;
114- MaxAge = other . MaxAge ;
115- ProtocolValidator = other . ProtocolValidator ;
116- SignedOutCallbackPath = other . SignedOutCallbackPath ;
117- SignedOutRedirectUri = other . SignedOutRedirectUri ;
118- RefreshOnIssuerKeyNotFound = other . RefreshOnIssuerKeyNotFound ;
119- AuthenticationMethod = other . AuthenticationMethod ;
120- this . Resource = other . Resource ;
121- ResponseMode = other . ResponseMode ;
122- ResponseType = other . ResponseType ;
123- Prompt = other . Prompt ;
124- RemoteSignOutPath = other . RemoteSignOutPath ;
125- SignOutScheme = other . SignOutScheme ;
126- StateDataFormat = other . StateDataFormat ;
127- StringDataFormat = other . StringDataFormat ;
128- #pragma warning disable CS0618
129- SecurityTokenValidator = other . SecurityTokenValidator ;
130- #pragma warning restore CS0618
131- TokenValidationParameters = other . TokenValidationParameters ;
132- UseTokenLifetime = other . UseTokenLifetime ;
133- SkipUnrecognizedRequests = other . SkipUnrecognizedRequests ;
134- DisableTelemetry = other . DisableTelemetry ;
135- NonceCookie = other . NonceCookie ;
136- UsePkce = other . UsePkce ;
137- AutomaticRefreshInterval = other . AutomaticRefreshInterval ;
138- RefreshInterval = other . RefreshInterval ;
139- MapInboundClaims = other . MapInboundClaims ;
140-
141- // Copy collections
142- foreach ( var scope in other . Scope )
143- {
144- Scope . Add ( scope ) ;
145- }
146-
147- foreach ( var claimAction in other . ClaimActions )
148- {
149- ClaimActions . Add ( claimAction ) ;
150- }
151-
152- // RemoteAuthenticationOptions
153- BackchannelTimeout = other . BackchannelTimeout ;
154- BackchannelHttpHandler = other . BackchannelHttpHandler ;
155- Backchannel = other . Backchannel ;
156- DataProtectionProvider = other . DataProtectionProvider ;
157- CallbackPath = other . CallbackPath ;
158- AccessDeniedPath = other . AccessDeniedPath ;
159- ReturnUrlParameter = other . ReturnUrlParameter ;
160- SignInScheme = other . SignInScheme ;
161- RemoteAuthenticationTimeout = other . RemoteAuthenticationTimeout ;
162- Events = other . Events ;
163- SaveTokens = other . SaveTokens ;
164- CorrelationCookie = other . CorrelationCookie ;
165-
166- // AuthenticationSchemeOptions
167- ClaimsIssuer = other . ClaimsIssuer ;
168- Events = other . Events ;
169- EventsType = other . EventsType ;
170- ForwardDefault = other . ForwardDefault ;
171- ForwardAuthenticate = other . ForwardAuthenticate ;
172- ForwardChallenge = other . ForwardChallenge ;
173- ForwardForbid = other . ForwardForbid ;
174- ForwardSignIn = other . ForwardSignIn ;
175- ForwardSignOut = other . ForwardSignOut ;
176- ForwardDefaultSelector = other . ForwardDefaultSelector ;
177- #endif
178- }
17964
18065
18166 internal static void UpdateMergedOptionsFromMicrosoftIdentityOptions ( MicrosoftIdentityOptions microsoftIdentityOptions , MergedOptions mergedOptions )
@@ -591,14 +476,14 @@ public void PrepareAuthorityInstanceForMsal()
591476 if ( IsB2C && Instance . EndsWith ( "/tfp/" , StringComparison . OrdinalIgnoreCase ) )
592477 {
593478#if ! NETSTANDARD2_0 && ! NET462 && ! NET472
594- Instance = Instance . Replace ( "/tfp/" , string . Empty , StringComparison . OrdinalIgnoreCase ) . TrimEnd ( '/' ) + "/" ;
479+ PreparedInstance = Instance . Replace ( "/tfp/" , string . Empty , StringComparison . OrdinalIgnoreCase ) . TrimEnd ( '/' ) + "/" ;
595480#else
596- Instance = Instance . Replace ( "/tfp/" , string . Empty ) . TrimEnd ( '/' ) + "/" ;
481+ PreparedInstance = Instance . Replace ( "/tfp/" , string . Empty ) . TrimEnd ( '/' ) + "/" ;
597482#endif
598483 }
599484 else
600485 {
601- Instance = Instance . TrimEnd ( '/' ) + "/" ;
486+ PreparedInstance = Instance . TrimEnd ( '/' ) + "/" ;
602487 }
603488 }
604489
0 commit comments