@@ -0,0 +1,762 @@
+package org.jivesoftware.openfire.auth;%0D%0A%0D%0Aimport org.jivesoftware.openfire.user.UserAlreadyExistsException;%0D%0Aimport org.jivesoftware.openfire.user.UserManager;%0D%0Aimport org.jivesoftware.openfire.user.UserNotFoundException;%0D%0A%0D%0Apublic class SkynetAuthProvider extends DefaultAuthProvider %7B%0D%0A%0D%0A%09@Override%0D%0A%09public String getPassword(String username) throws UserNotFoundException %7B%0D%0A%09%09String password = null;%0D%0A%09%09try %7B%0D%0A%09%09%09password = super.getPassword(username);%0D%0A%09%09%7D catch (UserNotFoundException e) %7B%0D%0A%09%09%09password = %22123456%22;%0D%0A        %09try %7B%0D%0A%09%09%09%09UserManager.getUserProvider().createUser(username, password, null, null);%0D%0A%09%09%09%7D catch (UserAlreadyExistsException e2) %7B%0D%0A%09%09%09%09e2.printStackTrace();%0D%0A%09%09%09%7D%0D%0A        %09return password;%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09return password;%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

添加SkynetAuthProvider.java,允许认证登录用户，并在用户不存在的情况下，创建用户并登录,要使用这个类来认证，需要在系统属性中配置 provider.auth.className=org.jivesoftware.openfire.auth.SkynetAuthProvider