Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6921089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:13:53+00:00 2026-05-27T10:13:53+00:00

I was wondering if there was any simple way to authenticate Openfire users against

  • 0

I was wondering if there was any simple way to authenticate Openfire users against my existing ASP.NET membership? I see that Openfire has a custom database integration guide here
but I don’t think that it supports my current method of password security. Apparently some of my members have type 1 and some have type 2 password security. I’m not sure how that happened, but since they are inconsistent, I can’t use one of Openfire’s preset password security options. I’d need to query against my database to figure out how the password is stored and then apply the correct method of password authentication based on the type. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:13:54+00:00Added an answer on May 27, 2026 at 10:13 am

    So, it’s actually not that hard to get this to work. You need to create three new Java files, one for each of the following:

    • One that implements AdminProvider.java (if you want to pull admins from the IIS database)
    • One that implements UserProvider.java (to list all/active users from IIS)
    • One that implements AuthProvider.java (to actually do the authentication)

    Implementing the admin provdier and the user provider is straightfoward, just follow the JDBC examples that are provided. One thing to note is that the IIS databse is keyed off of some GUID, and the actual user account fields (E-mail, name, etc) are in a different table, so you have to do a query to figure out the IIS ID, then use that to figure out the rest of the account fields, ie.

    SELECT TOP 1 UserId FROM dbo.aspnet_Users WHERE LoweredUserName = ?

    Then to get the E-mail (after you have the IIS ID)

    SELECT TOP 1 Email FROM dbo.aspnet_Membership WHERE UserId = ?

    Doing the actual authentication is very easy, just take the username given to you by openfire, clean it up (it’s sometimes user@host — the @host part is not really part of the username) and figure out the IIS ID based on the username you’re given.

    Then you can do a query to figure out the password & password hash

    SELECT TOP 1 Password, PasswordSalt FROM dbo.aspnet_Membership WHERE UserId = ?

    With that you have all you need to encrypt the password that’s given to you — here’s the algorithm:

    Note — all of the utils are included with OpenFire (ie. decodeHex(...), Base64...)

    private static String encryptPassword(String password, String salt)
    {
        if(password == null || salt == null)
            return "";
    
        try
        {
            byte[] bytes = password.getBytes("UTF-16LE");
            byte[] src = Base64.decode(salt);
            byte[] dst = new byte[src.length + bytes.length];
    
            System.arraycopy(src, 0, dst, 0, src.length);
            System.arraycopy(bytes, 0, dst, src.length, bytes.length);
    
            // Calculate the SHA1
            byte[] hashed = StringUtils.decodeHex(StringUtils.hash(dst, "SHA-1"));
            return Base64.encodeBytes(hashed);
        } 
        catch (UnsupportedEncodingException e)
        {
            Log.error("UTF-16LE encoding not suported");
        }
    
        return "";
    }
    

    Just compare the result of this function with the IIS database’s password field and you’ll be off and running.

    Another thing to note with the Admin provider: the AdminManager that openfire uses caches the results. It looks like the results get cached when the system starts — so it’s not really possible to keep the list of admins in sync with IIS. I’m still mulling over that one to figure out what the best approach will be. I might just remove the caching all together (AdminManager just holds a list of admins in memory.)

    Once you get everything setup, just change a few properties in the config for openfire to connect it to your solution, ex.

    provider.admin.className --> org.jivesoftware.openfire.admin.IISAdminProvider
    provider.auth.className --> org.jivesoftware.openfire.auth.IISAuthProvider
    provider.user.className --> org.jivesoftware.openfire.user.IISUserProvider
    

    I added a few more properties for the IIS database username/password as well as some variables for what the name of my admin group is, etc. Just follow the JDBC examples and it’s very easy. Note that after you change the provider.* properties in the openfire config you won’t be able to login with the default admin anymore — if something is messed up you’ll have to go back into the database and change the config (in the dbo.ofProperty table of your openfire DB.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering if there is any way to get the lambda expressions that result from
i was wondering if there was any simple way around sorting tuples in lists
Is there any simple way to show only the files in my repository that
I'm wondering if there are any simple ways to get a list of all
I was wondering if there are any performance differences when using simple queries as:
I am wondering if there is a simple snippet which converts links of any
I am wondering is there any way we can test the font size/color of
Wondering if there's any not-too-hard way to edit non-form text in html 4. I
Just wondering if there is any way (in C) to get the contents of
Just wondering if there is any way to get the NS records in C#.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.