@@ -705,25 +705,20 @@ private async Task ConfigureEntraAppsAsync(
705705 }
706706 else
707707 {
708- var msg = "A365 Proxy redirect URI was not returned by the server. Setting consent redirect URIs only ." ;
708+ var msg = "A365 Proxy redirect URI was not returned by the server. Redirect URI configuration skipped ." ;
709709 _logger . LogWarning ( msg ) ;
710710 concurrentWarnings . Add ( msg ) ;
711- tasks . Add ( SetConsentOnlyRedirectUrisAsync ( tenantId , apps . A365AppObjectId , apps . A365AppName , concurrentWarnings , ct ) ) ;
712711 }
713712
714713 if ( input . IsEntra && ! string . IsNullOrWhiteSpace ( remoteRedirectUri ) && apps . RemoteProxyObjectId != null )
715714 {
716715 tasks . Add ( UpdateRemoteProxyRedirectUrisAsync ( tenantId , apps , remoteRedirectUri , concurrentWarnings , ct ) ) ;
717716 }
718- else if ( input . IsEntra && apps . RemoteProxyObjectId != null )
717+ else if ( input . IsEntra && string . IsNullOrWhiteSpace ( remoteRedirectUri ) )
719718 {
720- if ( string . IsNullOrWhiteSpace ( remoteRedirectUri ) )
721- {
722- var msg = "Remote MCP Proxy redirect URI was not returned by the server. Setting consent redirect URIs only." ;
723- _logger . LogWarning ( msg ) ;
724- concurrentWarnings . Add ( msg ) ;
725- }
726- tasks . Add ( SetConsentOnlyRedirectUrisAsync ( tenantId , apps . RemoteProxyObjectId , apps . RemoteProxyAppName , concurrentWarnings , ct ) ) ;
719+ var msg = "Remote MCP Proxy redirect URI was not returned by the server. Redirect URI configuration skipped." ;
720+ _logger . LogWarning ( msg ) ;
721+ concurrentWarnings . Add ( msg ) ;
727722 }
728723 else if ( input . IsEntra && apps . RemoteProxyObjectId == null )
729724 {
@@ -790,10 +785,7 @@ private async Task UpdateA365RedirectUrisAsync(
790785 {
791786 var a365TcUri = DevelopMcpCommand . AddTcPrefix ( a365RedirectUri ) ;
792787 var a365NonTcUri = DevelopMcpCommand . RemoveTcPrefix ( a365RedirectUri ) ;
793- var a365Uris = DevelopMcpCommand . BuildRedirectUriList ( a365RedirectUri , a365TcUri , a365NonTcUri )
794- . Concat ( EntraAppProvisioner . GetConsentRedirectUris ( ) )
795- . Distinct ( StringComparer . Ordinal )
796- . ToArray ( ) ;
788+ var a365Uris = DevelopMcpCommand . BuildRedirectUriList ( a365RedirectUri , a365TcUri , a365NonTcUri ) ;
797789 _logger . LogDebug ( "Updating redirect URIs on '{AppName}' ({ObjectId})" , apps . A365AppName , apps . A365AppObjectId ) ;
798790 var success = await _retryHelper . ExecuteWithRetryAsync (
799791 async retryCt => await _graphApiService ! . UpdateAppRedirectUrisAsync ( tenantId , apps . A365AppObjectId , a365Uris , retryCt ) ,
@@ -827,10 +819,7 @@ private async Task UpdateRemoteProxyRedirectUrisAsync(
827819 {
828820 var remoteTcUri = DevelopMcpCommand . AddTcPrefix ( remoteRedirectUri ) ;
829821 var remoteNonTcUri = DevelopMcpCommand . RemoveTcPrefix ( remoteRedirectUri ) ;
830- var remoteUris = DevelopMcpCommand . BuildRedirectUriList ( remoteRedirectUri , remoteTcUri , remoteNonTcUri )
831- . Concat ( EntraAppProvisioner . GetConsentRedirectUris ( ) )
832- . Distinct ( StringComparer . Ordinal )
833- . ToArray ( ) ;
822+ var remoteUris = DevelopMcpCommand . BuildRedirectUriList ( remoteRedirectUri , remoteTcUri , remoteNonTcUri ) ;
834823 _logger . LogDebug ( "Updating redirect URIs on '{AppName}' ({ObjectId})" , apps . RemoteProxyAppName , apps . RemoteProxyObjectId ) ;
835824 var success = await _retryHelper . ExecuteWithRetryAsync (
836825 async retryCt => await _graphApiService ! . UpdateAppRedirectUrisAsync ( tenantId , apps . RemoteProxyObjectId ! , remoteUris , retryCt ) ,
@@ -855,37 +844,6 @@ private async Task UpdateRemoteProxyRedirectUrisAsync(
855844 }
856845 }
857846
858- private async Task SetConsentOnlyRedirectUrisAsync (
859- string tenantId , string objectId , string appName ,
860- System . Collections . Concurrent . ConcurrentBag < string > concurrentWarnings ,
861- CancellationToken ct = default )
862- {
863- try
864- {
865- var consentUris = EntraAppProvisioner . GetConsentRedirectUris ( ) ;
866- var success = await _retryHelper . ExecuteWithRetryAsync (
867- async retryCt => await _graphApiService ! . UpdateAppRedirectUrisAsync ( tenantId , objectId , consentUris , retryCt ) ,
868- result => ! result ,
869- cancellationToken : ct ) ;
870- if ( ! success )
871- {
872- var msg = $ "Failed to set web redirect URIs on '{ appName } ' after retries.";
873- _logger . LogError ( msg ) ;
874- concurrentWarnings . Add ( msg ) ;
875- }
876- else
877- {
878- _logger . LogDebug ( "Set {Count} web redirect URIs on '{AppName}'" , consentUris . Length , appName ) ;
879- }
880- }
881- catch ( Exception ex )
882- {
883- var msg = $ "Failed to set web redirect URIs on '{ appName } ': { ex . Message } ";
884- _logger . LogError ( msg ) ;
885- concurrentWarnings . Add ( msg ) ;
886- }
887- }
888-
889847 private async Task AddRemoteProxyScopePermissionAsync (
890848 string tenantId , ResolvedInput input , EntraAppSet apps ,
891849 System . Collections . Concurrent . ConcurrentBag < string > concurrentWarnings ,
0 commit comments