Login/Register Via Java Web App
-
I have a website that runs on Java (Tomcat, MySQL).
I am in the process of adding a blog to the website by integrating WordPress into the website (ie: https://www.mysite.com/blog will be the domain of the WordPress blog, the rest will be my (non-WordPress) site).
I want to have only one register/login and for that to be through the main (non-WordPress) site. Also, if a user is logged in to the main site, he should also be logged into the WP site.
To do this I was thinking of doing the following:
1) Move all current users into the wp_users table and add all new users to that table.
2) Forward WP login to non-WP login form. Enter userId and random UUID into a custom table on WP database and attach the UUID as a parameter to the URL (which will also contain the url from which the user arrived, so if they arrived from the WP site it will forward them back to the WP site).
3) On forum pages, if not logged in, check for UUID parameter and if it exists log the user in (with functions such as
wp_set_current_user
andwp_set_auth_cookie
, etc.).Does this seem like a reasonable method? Is there a preferred way to do this? Are there any flaws with my proposed setup? I’m new to PHP and WP so I might have overlooked an easier solution.
Thank you.
- The topic ‘Login/Register Via Java Web App’ is closed to new replies.