File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/Microsoft.Identity.Web.TokenAcquisition Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -643,6 +643,9 @@ public async Task<AuthenticationResult> GetAuthenticationResultForAppAsync(
643643 tokenAcquisitionOptions . PopClaim ! ) ;
644644 }
645645 }
646+
647+ //Add extra body parameters configured by extensions
648+ AddExtraBodyParametersIfNeeded ( tokenAcquisitionOptions , builder ) ;
646649 }
647650
648651 try
@@ -676,6 +679,18 @@ public async Task<AuthenticationResult> GetAuthenticationResultForAppAsync(
676679 }
677680 }
678681
682+ private void AddExtraBodyParametersIfNeeded ( TokenAcquisitionOptions tokenAcquisitionOptions , AcquireTokenForClientParameterBuilder builder )
683+ {
684+ if ( tokenAcquisitionOptions . ExtraParameters != null
685+ && tokenAcquisitionOptions . ExtraParameters . TryGetValue ( "EXTRA_BODY_PARAMETERS" , out object ? parameters ) )
686+ {
687+ if ( parameters is Dictionary < string , Func < CancellationToken , Task < string > > > keyValuePairs )
688+ {
689+ builder . WithExtraBodyParameters ( keyValuePairs ) ;
690+ }
691+ }
692+ }
693+
679694 private MergedOptions GetMergedOptions ( string ? authenticationScheme , TokenAcquisitionOptions ? tokenAcquisitionOptions )
680695 {
681696 MergedOptions mergedOptions ;
You can’t perform that action at this time.
0 commit comments