public override void Authenticate(IWampSessionClient client, string signature, AuthenticateExtraData extra) { IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>; IWampSessionAuthenticator authenticator = wampClient.Authenticator; try { authenticator.Authenticate(signature, extra); if (authenticator.IsAuthenticated) { OnClientAuthenticated(wampClient, wampClient.HelloDetails); } else { SendAbort(client, new WampAuthenticationException(new AbortDetails(), WampErrors.AuthorizationFailed)); } } catch (WampAuthenticationException ex) { SendAbort(client, ex); } }
private static void SendAbort(IWampSessionClient client, WampAuthenticationException ex) { using (IDisposable disposable = client as IDisposable) { client.Abort(ex.Details, ex.Reason); } }
public virtual void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason) { IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>; if (!wampClient.GoodbyeSent) { wampClient.SendGoodbye(details, WampErrors.CloseNormal); } }
public virtual void Abort(IWampSessionClient client, AbortDetails details, string reason) { using (IDisposable disposable = client as IDisposable) { IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>; wampClient.GoodbyeSent = true; wampClient.Realm.Abort(wampClient.Session, details, reason); } }
public virtual void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason) { using (IDisposable disposable = client as IDisposable) { client.Goodbye(details, WampErrors.CloseNormal); IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>; wampClient.GoodbyeSent = true; wampClient.Realm.Goodbye(wampClient.Session, details, reason); } }
protected IWampClientProxy <TMessage> GetWampClient(IWampSessionClient client, string realm, HelloDetails details) { IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>; IWampBindedRealm <TMessage> bindedRealm = RealmContainer.GetRealmByName(realm); wampClient.HelloDetails = details; details.TransportDetails = wampClient.TransportDetails; wampClient.Realm = bindedRealm; return(wampClient); }
public override void Hello(IWampSessionClient client, string realm, HelloDetails details) { IWampClientProxy <TMessage> wampClient = GetWampClient(client, realm, details); WampPendingClientDetails clientDetails = new WampPendingClientDetails() { HelloDetails = details, Realm = realm, SessionId = wampClient.Session }; try { IWampSessionAuthenticator authenticator = mSessionAuthenticatorFactory.GetSessionAuthenticator (clientDetails, wampClient.Authenticator); if (authenticator == null) { throw new Exception("Get null authenticator."); } wampClient.Authenticator = authenticator; bool authenticated = authenticator.IsAuthenticated; if (authenticated) { OnClientAuthenticated(wampClient, details); } else { wampClient.Challenge(authenticator.AuthenticationMethod, authenticator.ChallengeDetails); } } catch (WampAuthenticationException ex) { SendAbort(client, ex); } }
public void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason) { }
public virtual void Authenticate(IWampSessionClient client, string signature, AuthenticateExtraData extra) { }
public virtual void Abort(IWampSessionClient client, AbortDetails details, string reason) { }
public virtual void Hello(IWampSessionClient client, string realm, HelloDetails details) { }
public override void Hello(IWampSessionClient client, string realm, HelloDetails details) { client.Challenge(mAuthMethod, mDetails); }
public override void Authenticate(IWampSessionClient client, string signature, AuthenticateExtraData extra) { Extra = extra; Signature = signature; }
public void Authenticate(IWampSessionClient client, string signature, AuthenticateExtraData extra) { throw new System.NotImplementedException(); }
public void Hello(IWampSessionClient client, string realm, HelloDetails details) { client.Welcome(83782, new WelcomeDetails()); }
public virtual void Authenticate(IWampSessionClient client, string signature, AuthenticateExtraData extra) { // TODO: disconnect client. }
public virtual void Hello(IWampSessionClient client, string realm, HelloDetails details) { IWampClientProxy <TMessage> wampClient = GetWampClient(client, realm, details); OnClientJoin(wampClient, details); }
public void Abort(IWampSessionClient client, AbortDetails details, string reason) { throw new System.NotImplementedException(); }
public override void Abort(IWampSessionClient client, AbortDetails details, string reason) { Reason = reason; Details = details; }
public void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason) { throw new System.NotImplementedException(); }
public virtual void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason) { mSession.Goodbye(client, details, reason); }