Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

OAuth2 provider setup

Step-by-step guides for connecting Setyenv to major OAuth2 services.

OAuth connections are defined and stored in WP-PFManagement (as an OAuth Client connection); WP-PFWorkflow runs the OAuth flow and consumes the connection as a node. The tokens live only in Management. See OAuth outbound for the workflow node and OAuth Client for the connection configuration in Management.

Generic OAuth2 flow

  1. Register an application with the service provider to get a Client ID and Secret.
  2. In WP-PFManagement, create an OAuth Client connection: enter the Client ID, Client Secret, the provider's authorize/token endpoints and the required scopes.
  3. Start the authorization from that connection — you'll be redirected to the provider's authorisation page.
  4. Approve the access request. You're redirected back to WordPress and the issued token is stored on the connection in Management.
  5. In a workflow, use the OAuth-backed connection on any outbound call. The engine applies the bearer token automatically and refreshes it when it expires.

The redirect / callback URL to register with every provider below is https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback — WP-PFWorkflow runs the flow, so the callback lives on the Workflow REST namespace.

Google APIs (Gmail, Sheets, Drive, Calendar)

  1. Go to Google Cloud Console
  2. Create a project → APIs & Services → Credentials
  3. Create an OAuth 2.0 Client ID (Web application)
  4. Add authorised redirect URI: https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback
  5. Copy the Client ID and Client Secret into the OAuth Client connection in WP-PFManagement.
  6. Scopes: https://www.googleapis.com/auth/gmail.send for email, etc.

Microsoft 365 (Outlook, SharePoint, Teams)

  1. Go to Azure Portal → App registrations
  2. Register a new application (Web redirect URI: https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback)
  3. Copy the Application (client) ID and client secret into the OAuth Client connection in WP-PFManagement.
  4. Scopes: Mail.Send, Files.ReadWrite, etc.

GitHub

  1. Settings → Developer settings → OAuth Apps → New OAuth App
  2. Authorisation callback URL: https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback
  3. Copy the Client ID and Client Secret into the OAuth Client connection in WP-PFManagement.
  4. Scopes: repo, workflow, admin:org, etc.

Salesforce

  1. Setup → Apps → App Manager → New Connected App
  2. Enable OAuth settings → Callback URL: https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback
  3. Add selected OAuth scopes
  4. Copy the Consumer Key and Consumer Secret into the OAuth Client connection in WP-PFManagement.
For self-signed or localhost WordPress sites, some providers
require HTTPS. Use a tool like ngrok for local development.