Skip to content
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

System.InvalidOperationException: The required UserNameSecurityToken was not provided #4562

Closed
dimalyshev opened this issue Mar 12, 2021 · 5 comments · Fixed by #4563
Closed
Assignees
Labels
customer assistance Help customers with questions regarding usage of WCF features. triaged

Comments

@dimalyshev
Copy link
Contributor

Configuring proxy with AuthenticationSchemes.Basic (see code) results in error in title:
Related issue #4557

                var customBinding = new CustomBinding(result);

                var htbe = customBinding.Elements.Find<HttpTransportBindingElement>();
                htbe.ProxyAuthenticationScheme = AuthenticationSchemes.Basic; // Or whatever authentication mechanism your proxy server uses
                htbe.BypassProxyOnLocal = true;
                htbe.UseDefaultWebProxy = false;

                htbe.ProxyAddress = new Uri("http://user:pass@someproxy");
@dimalyshev
Copy link
Contributor Author

dimalyshev commented Mar 12, 2021

Exception stack for #4562 here:

System.InvalidOperationException: The required UserNameSecurityToken was not provided.
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) in \wcf\System.Private.ServiceModel\src\Internals\System\Runtime\AsyncResult.cs:line 354
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) in \wcf\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannel.cs:line 1909
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) in \wcf\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannel.cs:line 806
   at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult) in \wcf\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannelProxy.cs:line 184
--- End of stack trace from previous location where exception was thrown ---

@dimalyshev
Copy link
Contributor Author

@mconnew why not to label this issue as bug ?
Now there is no bypass to use proxy with Basic auth along with WCF libraries.

May be it'll speedup including patch into release?

@mconnew mconnew reopened this Apr 16, 2021
@mconnew
Copy link
Member

mconnew commented Apr 16, 2021

PR merge auto closed this issue so reopening. Marking it as a bug won't make any difference to how quickly this will get resolved. It's used for book keeping only, and we use ZenHub to manage issues that need working on so it's not really used to prioritize or organize.

@dimalyshev
Copy link
Contributor Author

dimalyshev commented Apr 16, 2021

Thanks a lot...

@HongGit HongGit added the customer assistance Help customers with questions regarding usage of WCF features. label Jun 25, 2021
@HongGit
Copy link
Contributor

HongGit commented Jul 19, 2023

Close as this issue is already resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer assistance Help customers with questions regarding usage of WCF features. triaged
Projects
None yet
3 participants