Automatically chosen Authentication
import { Wampy } from 'wampy';
import * as wampyCra from 'wampy-cra';
import * as wampyCS from 'wampy-cryptosign';
wampy = new Wampy('wss://wamp.router.url', {
realm: 'realm1',
authid: 'patrik',
authmethods: ['ticket', 'wampcra', 'cryptosign'],
authextra: { // User public key for Cryptosign-based Authentication
pubkey: '545efb0a2192db8d43f118e9bf9aee081466e1ef36c708b96ee6f62dddad9122'
},
authPlugins: {
ticket: (function(userPassword) { return function() { return userPassword; }})(),
wampcra: wampyCra.sign(userSecret),
cryptosign: wampyCS.sign(userPrivateKey)
},
authMode: 'auto',
onChallenge: null
});Last updated