Skip to content
Kevin Hoffman edited this page May 8, 2018 · 8 revisions

The WP Business Reviews Server plugin provides authentication for platforms in the WP Business Reviews Client plugin. At this time, Facebook (OAuth2) is the only platform that requires server-side authentication. Other platforms are able to authenticate within the Client plugin.

The Client-Server Relationship

How It Works

  1. User initiates Facebook OAuth2 authentication by clicking Connect to Facebook within the WP Business Reviews Client plugin settings screen.
  2. The Server plugin receives the request at https://wpbusinessreviews.com/facebook-token/request/ and redirects the user to Facebook. The URL of the Client plugin settings screen is encoded in the URL so that the user can ultimately be redirected back to their site.
  3. If the user is not logged in, they will be asked to log in to Facebook.
  4. If the user has not given the app permissions, they will be asked for permissions.
  5. After confirming permissions, Facebook redirects the user to https://wpbusinessreviews.com/facebook-token/response/ where a long-lived user access token is generated (expires after 60 days).
  6. The user access token populates a hidden form field and is sent back to the Client plugin using POST method.
  7. The Client plugin stores the user access token in the WordPress database.
  8. The Client plugin uses the user access token to generate permanent page access tokens, which are also stored in the WordPress database.

Production Setup

See production setup instructions.

Local Development

See local development instructions.

Clone this wiki locally