cookies - WordPress-based authentication from other webapp -


work

I probably want to create a webpage in Wadin, and I want to have a WordPress site They want to use it within the admin area. Most things are clear:

  • I can create a WP plugin, which will display the Widin app in an iframe inside the WP admin.
  • Plugin be able to create menu inside WP admin

But

I am not completely convinced, how can I authenticate my user? I want to use WordPress's athletic system if my users are logged on to WP site, and there are rights to administer them, I want to show them their site. Otherwise, I would like to throw HTTP404, or whatever.

I have already done

I have checked the cookies, makes WordPress when I have logged into my site, so I have 2 cookies:

  • wordpress_HASH
  • wordpress_logged_in_HASH

where hash > The site's URL is MD5 hash.

These cookies look like this:

  • wordpress_HASH :
    admin% 7C1422101199% 7Ckd5Qp39eAQc4JNZTUBxlSjAMKeQqdCX00l6bnc64dxu% 7C3f19a3dd6e12f7c342059a40c7ffe64b923dc9f46707d67d303b0a8333344818
  • wordpress_logged_in_HASH :
    admin% 7C1422101199% 7Ckd5Qp39eAQc4JNZTUBxlSjAMKeQqdCX00l6bnc64dxu% 7Cdf8a63d871c0830ef98732e7deb68b28b58a8618bc7c42e36a1e26a13494f1ae

I found it Is:

  • the 7C% is a delimiter, which means | .
  • The first part of this value is the name of the user, it is called admin in the present case.
  • The second part ( 1422101199 ) is a Unix timestamp, it is the cookie experienced date.
  • The third part ( kd5Qp39eAQc4JNZTUBxlSjAMKeQqdCX00l6bnc64dxu ) is a session ID
    • I'm not sure how this is random, is it random?
    • I have found a sha256 hash in DH under the WP_urmeta table, with a foreign key for my user (in this case of the administrator), a meta_'s session_tokens with. This value is a JSON-like string, and contains some data about the user: its browser, experience time, and all the hashes of session EDS currently used. What is this string? How can I parse it? This is not completely JSON.
    • And one fourth, which is different in two cookies. I do not know what the heck is.

    My thoughts

    My idea is to parse this cookie from this app, and compare it to data for data in DB but I have a lot of questions Are there.

    • Is it safe?
    • Is there a better way?
    • Why are two cookies? What is the difference between them?

    Thank you!

If you are just reading the cookie username, a bad user can find the user's name and address That's fake and can get access to your Wadien based piece.

If you want a simple and secure solution, you can check your WordPress hosting on JVM using Quarks. I am working on a site and doing it very well, you can make a hook in your WP faster than the original lamp stack (without PHP accelerator).

Another simple and safest way to use PHP is to use a PHP session. I do not know how easy it is to read basic PHP session data from JVM, but there are some types of optional xml (WDDX) formats in it. It should be easy to handle in Java - assuming that you can read a session cookie from your servlet, the last option is to random randomly create another related data (at least username) stored in some flatfile or WP database (Which you are probably using anyway).


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -