-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to change the authid #7
Comments
Im not sure you should be able to change that... authid is a response by the router after authentication, clients should not be able to change it. Is it possible with AutobahnJS to change the authid on demand after successfully connecting? |
Yeah, you can't change the authid after login. My use case is that I use the authid as username and token challenge as password for a web interface. I manually close the session and reopen a new one. |
1 similar comment
Yeah, you can't change the authid after login. My use case is that I use the authid as username and token challenge as password for a web interface. I manually close the session and reopen a new one. |
Any news on this issue? So in that case, how to handle the authentication options? I tried to do a reconnect, but having problem with pass the new options and to force autobahn to reconnect. |
As far as I know, you SHOULD NOT change the authid from the client side. It might not even be possible. Authid is provided by the registered dynamic authenticators, or the static rules in the config. Closing this issue as it is unsupported by crossbar |
You can, if you disconnect then reconnect. An easy way to do that would be handy. |
@Yamakaky could you paste in a code snippet of your re-auth process? |
export const reconnect = (() => {
let connection
return () => {
if (connection) {
// Throws if already closed
try {
connection.close("closing_old_connection")
} catch (e) {
console.error(e)
}
}
return new window.Promise((resolve, reject) => {
const url = ...
const realm = ...
connection = new autobahn.Connection({
url,
realm,
authmethods: [
"cookie",
],
authid: username,
onchallenge: onchallenge,
})
connection.onopen = (...args) => {
onopen(...args)
resolve()
}
connection.onclose = (...args) => {
reject()
onclose(...args)
}
connection.open()
})
}
})() |
Currently, it's not possible to change the authid after the VueWamp object creation. Maybe by redoing the
Vue.use...
?A cleaner way would be to handle it directly in the plugin.
The text was updated successfully, but these errors were encountered: