OpenFire logging in using a custom table

Source: Internet
Author: User
Tags auth

Because the project needs, the user name in the project can not be unique, so openfire in the project cannot use the username in the Ofuser table to log in, after deliberation, two ways to solve:

1. Mark the contents of the Username field, for example, the original user name is Yezi, after the Mark Yezi#h, this h is our project distinguishes the different user name the way, this method does not have the technology, does not elaborate;

2, add a field in the Ofuser (because we have been using the Ofuser table), the field name is UserID, the primary key, self-growth, and then through the OpenFire custom login mode to configure;

Log in to the OpenFire backend management system and click on the system properties in Server Manager, as shown below:


Here can be openfire configuration and modification of the system properties, and the content of this page configuration is saved in the OpenFire database Ofproperty table, keyi open to see


It doesn't explain what's inside, it's some openfire system setup.


OK, the ink is finished, start to say:

All I need now is login with UserID.

Find Org.jivesoftware.openfire.auth.JDBCAuthProvider in OpenFire source, in the beginning of the file, we can see



Probably means to change the provider.auth.className to Org.jivesoftware.openfire.auth.JDBCAuthProvider, after the login verification to go Jdbcauthprovider code, there are some parameters that need to be configured, the rules have been, to configure it.

Depending on your needs, my configuration is as follows:


After configuration, restart the OpenFire, you can log in (the database password is clear, not encrypted, encrypted after the password verification said), but OpenFire management system login not to go in

Workaround: View the Peopvalue field value for Admin.authorizedjids in the Ofproperty table, in the format username@ ' Domain name ', where username should be the data that exists in the table, the domain name is the Peopvalue field value of Xmpp.domain, OK now can be landed successfully via spark and background management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.