Inband Account Registration
Inband account registration allows users to create accounts on the server automatically using most clients. It does not affect the ability to create new accounts through this web administration interface. Administrators may want to disable this option so users are required to register by other means (e.g. sending requests to the server administrator or through your own custom web interface).
Change Password
You can choose whether users are allowed to change their password. Password changing is independent from inband account registration. However, you may only want to disable this feature when disabling inband account registration.
Anonymous Login
You can choose to enable or disable anonymous user login. If it is enabled, anyone can connect to the server and create a new session. If it is disabled only users who have accounts will be able to connect.
Openfire預設有開啟Inband註冊機制,使用這個插件 https://github.com/metajack/strophejs-plugins/tree/master/register 就可以。
Just link the register plugin below the strophe library in your HTML head section:
<head>
<!-- ... -->
<script type="text/javascript" src="strophe.min.js"></script>
<script type="text/javascript" src="strophe.register.js"></script>
<!-- ... -->
</head>
Before you connect:
var callback = function (status) {
if (status === Strophe.Status.REGISTER) {
connection.register.fields.username = "juliet";
connection.register.fields.password = "R0m30";
connection.register.submit();
} else if (status === Strophe.Status.REGISTERED) {
console.log("registered!");
connection.authenticate();
} else if (status === Strophe.Status.CONNECTED) {
console.log("logged in!");
} else {
// every other status a connection.connect would receive
}
};
connection.register.connect("example.com", callback, wait, hold);
After that you're logged in with a fresh smelling jid.
來實做看看,ejabberd的port是5280,而openfire是7070
沒有留言:
張貼留言