/// <summary> /// Authenticate the WAMP session to server. /// </summary> /// <param name="proxy">The proxy.</param> /// <param name="formatter">The formatter.</param> /// <param name="authKey">The key of the authentication credentials, something like a user or /// application name.</param> /// <param name="authExtra">Any extra authentication information.</param> /// <param name="authSecret">The secret of the authentication credentials, something like the user /// password or application secret key.</param> /// <returns>The WampCraPermissions.</returns> static WampCraPermissions Authenticate(IWampCraProcedures proxy, IWampFormatter <JToken> formatter, string authKey, IDictionary <string, string> authExtra, string authSecret) { string challenge = proxy.AuthReq(authKey, authExtra); if (string.IsNullOrEmpty(authKey)) { return(proxy.Auth(null)); } WampCraChallenge info = formatter.Deserialize <WampCraChallenge>(JObject.Parse(challenge)); string sig = WampCraHelpers.AuthSignature(challenge, authSecret, info.authextra); return(proxy.Auth(sig)); }
public WampCraPendingAuth(WampCraChallenge authInfo, string signature, WampCraPermissions permissions) { AuthInfo = authInfo; Signature = signature; Permissions = permissions; }