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
- Register an application with the service provider to get a Client ID and Secret.
- In WP-PFManagement, create an OAuth Client connection: enter the Client ID, Client Secret, the provider's authorize/token endpoints and the required scopes.
- Start the authorization from that connection — you'll be redirected to the provider's authorisation page.
- Approve the access request. You're redirected back to WordPress and the issued token is stored on the connection in Management.
- 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)
- Go to Google Cloud Console
- Create a project → APIs & Services → Credentials
- Create an OAuth 2.0 Client ID (Web application)
- Add authorised redirect URI:
https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback - Copy the Client ID and Client Secret into the OAuth Client connection in WP-PFManagement.
- Scopes:
https://www.googleapis.com/auth/gmail.sendfor email, etc.
Microsoft 365 (Outlook, SharePoint, Teams)
- Go to Azure Portal → App registrations
- Register a new application (Web redirect URI:
https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback) - Copy the Application (client) ID and client secret into the OAuth Client connection in WP-PFManagement.
- Scopes:
Mail.Send,Files.ReadWrite, etc.
GitHub
- Settings → Developer settings → OAuth Apps → New OAuth App
- Authorisation callback URL:
https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback - Copy the Client ID and Client Secret into the OAuth Client connection in WP-PFManagement.
- Scopes:
repo,workflow,admin:org, etc.
Salesforce
- Setup → Apps → App Manager → New Connected App
- Enable OAuth settings → Callback URL:
https://yoursite.com/wp-json/wp-pfworkflow/v1/oauth/callback - Add selected OAuth scopes
- 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.
require HTTPS. Use a tool like ngrok for local development.