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

How to set ClientCredentialType as UserName in .net Core? #2544

Closed
sturlath opened this issue Feb 6, 2018 · 3 comments
Closed

How to set ClientCredentialType as UserName in .net Core? #2544

sturlath opened this issue Feb 6, 2018 · 3 comments
Assignees
Milestone

Comments

@sturlath
Copy link

sturlath commented Feb 6, 2018

I have been trying to use WCF in a .net core 2.0 project, for 2 days without luck. I have a StackOverflow question with all my tries and problems but I´m stuck! I just can´t reproduce my old code in .net Core.

Is it even possible to use ClientCredentialType.UserName í .net Core project?
And how is it done?

If only there were more tests. This unittest is basically the only thing I found and its quite basic.

I so hope somebody here can help me.

dotnet --info
.NET Command Line Tools (2.1.4)

Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190

Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.4\

@zhenlan
Copy link
Member

zhenlan commented Feb 6, 2018

@sturlath, what's the binding you are using? Please note message security is not supported (#8). Here are some examples of supported bindings.

https://github.com/dotnet/wcf/blob/master/src/System.Private.ServiceModel/tests/Scenarios/Security/TransportSecurity/Https/ClientCredentialTypeTests.4.1.0.cs

@sturlath
Copy link
Author

sturlath commented Feb 7, 2018

Thank you so much @zhenlan. My fault not finding these tests. I tried to search for them but maybe I did´t find them because I did´t know what to search for. The barrier to entry to WCF if quite high, especially if you don´t touch it often (years apart). I tried to amend that by answering my own question on StackOverflow and point to the resources needed to solve my problem. Please feel free to add to that answer if you have some other resources we should know about.

But thank you for your help. It was much appreciated!

P.s
I thought the code in the unittests you pointed out worked but I experienced the exception here below when fully implementing it (in async)

"This OperationContextScope is being disposed out of order."

and had to implement the code like mentioned here.

I updated my answer on StackOverflow with this information. Please feel free to comment on it if I´m doing something wrong.

@zhenlan
Copy link
Member

zhenlan commented Feb 8, 2018

I am glad it worked for you, @sturlath. Thanks for sharing your answers on the stackoverflow, which may help more people out there.

@zhenlan zhenlan closed this as completed Feb 8, 2018
@zhenlan zhenlan self-assigned this Feb 8, 2018
@zhenlan zhenlan added this to the S131 milestone Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants