Forget the user-password. You are not using it, you are trying to kludge it. Just use the variable you have, or the facsimile you are making.

This is freeradius, there are at least a dozen ways of doing what you want, Alan has given you a fine method

alan