Closed NeilC closed 7 years ago
Do you mean server auth? I didn't find it necessary to create a wrapper for that, you can use the onchallange
callback, as per AutobahnJS definition:
Vue.use(VueWamp, {
url: 'wss://crossbar.io/ws',
realm: 'default',
authmethods: ["cookie","wampcra"],
authid: 'authID',
max_retries: 3,
onchallenge: function(session, method, extra) {
if (method === "wampcra") {
return autobahn.auth_cra.sign('<my token>', extra.challenge);
} else {
throw "don't know how to authenticate using '" + method + "'";
}
},
onopen(session, details) {
console.debug('WAMP opened: ', session, details);
},
onerror(error) {
console.error(error);
}
});
What would be your use-case?
@lajosbencz , I am trying to use your library, it's great. A related question, how do you do authentication when you have a single page app?
I mean, I want to get the
So what's your solution? ideally I want to have a function to pass the options and trigger the connection.
Thank you for your nice work.
@lajosbencz thanks for the example, this answers my question.
Any plans for authentication support?