最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Use WP cookie to authentificate user on an external app

programmeradmin6浏览0评论

Is it possible to authentificate a logged in WP user by it's wp auth cookie from an external app (simple JS webapp on a different domain)?

The setup is:

  • My webapp is on domain/generator/
  • The wordpress installation is on users.domain
  • Same server, I have access to the WP DB

The problem: The nonce which is needed to validate the wp auth cookie is only available inside wp. But I have to check that from outside WP.

At the moment a user always has to log in on my external app. Authentification is done using the JWT Auth Plugin. That works perfect. I only don't like the fact, that the user has to login again although it is already logged in via WP.

Any ideas how to make it work by using the standard wp login?

What I want to know:

  • Is a user logged in?
  • If yes, whats the ID of that logged in user?
发布评论

评论列表(0)

  1. 暂无评论