Forum Replies Created
-
In reply to: integrating with external authentication system
Oh, last post was a mistake.
I finally figured it out. I was right with the last thing I tried…the function to change was validate_auth_cookie, which should return an integer representing the user ID. (It wasn’t working because I hadn’t yet set that user’s capabilities in the database.)
So, for anyone trying to do the same thing: the function that needs to be rewritten is validate_auth_cookie in class.wp-auth.php. Write your own function to validate the cookie, and return a user ID (int).
In reply to: integrating with external authentication systemStill trying to figure this out–I think I just need to find the place where bbPress finds out the ID of the current user, and insert my own function.
I looked in class.wp-auth.php as well as pluggable.php. As a test, I tried changing the validate_auth_cookie and get_current_user functions to “return XXXXX” in order to login user XXXXX automatically, but it didn’t work. I’m not sure if I’m changing the right functions, or if I’m returning the wrong information.
Is the ID number enough information to log a user in?
Where does it need to be provided?
There are a number of old threads with similar questions, but it seems like nobody has found an answer…
Thanks again!
In reply to: integrating with external authentication systemActually, to be more specific, it looks like I should be replacing one of the following functions: bb_auth(), bb_is_user_authorized(), bb_is_user_logged_in(), or bb_get_current_user().
However, I’m not sure which ones to leave alone (in case they are used by other parts of the application), or how to specify the user ID.