-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Host with multiple transports having different auth types #328
Comments
It seems to me like the problem is that you have a single Elad |
Oh I didn't know it's sent in the arguments like that. That's very convenient. I actually have two separatate |
Can you attach here your master factory code please? Thanks |
Yeah, I'll fix that. Maybe the WampPendingClientDetails class should also
include the transport itself for the case where you have two instances of a
transport of the same type with different authorization methods.
Elad
…On Thu, Dec 10, 2020, 16:59 Andrej Kmetík ***@***.***> wrote:
Well it does not work since the TransportDetails object is null.
[image: Screenshot 2020-12-10 22 58 16]
<https://user-images.githubusercontent.com/5548662/101834975-5def3880-3b3b-11eb-85b1-23ab65f69f2d.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#328 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIS75QSPRU4EBJRVO65ILTSUFAF7ANCNFSM4UTXX54A>
.
|
I was thinking about it and in my opinion it's a hacky solution. |
We'll have to change some api. // Allows to map different bindings to different authentication methods
public void RegisterTransport(IWampTransport transport, IDictonary<IWampBinding, IWampSessionAuthenticatorFactory> bindingToAuthenticationFactory); If we remove the original overload: public void RegisterTransport(IWampTransport transport, IEnumerable<IWampBinding> bindings) this will break api and also won't allow I also checked and authentication for |
Hi Esso, I just pushed a commit with this feature. Can you try it out? The version is Usage: WampMultiAuthenticationHost host =
new WampMultiAuthenticationHost();
host.RegisterTransport(new FleckWebSocketTransport("ws://127.0.0.1:8080/ws"),
new Dictionary<IWampBinding, IWampSessionAuthenticatorFactory>()
{
{new JTokenJsonBinding(), new WampCraUserDbAuthenticationFactory(new MyAuthenticationProvider(), new MyUserDb())},
{new JTokenMessagePackBinding(), new MyAuthenticatorFactory()}
}); Thanks |
Hi Elad, I propose adding another overload: void RegisterTransport(IWampTransport transport, IEnumerable<IWampBinding> bindings, IWampSessionAuthenticatorFactory sessionAuthenticatorFactory); Since it's likely going to be the most common use-case to add the same auth factory to all the bindings on the given transport. |
I did some tests in production environment with this and found no issues. |
Great! I plan to release a new version of WampSharp at some point containing these changes and also the changes of #330, but it will take me some time unfortunately. |
Hi @darkl, Thanks, |
Hi Esso, I'm currently very busy. I'll have more time after March 15th. Elad |
Alright, we'll be patiently waiting then :) |
Version 22.5.1 is now available on NuGet! |
Hello,
I need to create a Host that has multiple transports having different types of authentication.
My case:
I tried using code from WampAuthenticationHost but I ended up with endless internal dependency chain (I gave up after copying more than dozen classes).
I just need to have 2 different
RegisterTransport
methods, one which usesCreateAuthenticationBinding
(this one usesWampAuthenticationBinaryBinding
,WampAuthenticationBinaryBinding
andWampAuthenticationBinding
which are all internal and have other internal dependencies) and one which does not.I also tried to use implementation of
WampHost
and edit that but that's even worse, almost everything is internal.Is there a simple way to do this? Or is it at least possible to make most of those things public?
Thanks
Esso
The text was updated successfully, but these errors were encountered: