カスタムOAuth アプリケーションの作成
Creating a Custom OAuth Application
Creating a custom OAuth 2.0 application for authenticating to WooCommerce entails installing the WooCommerce OAuth 2.0 plugin and adding a new OAuth client application via the WooCommerce admin panel.
Installing the Plugin
Before you can authenticate via OAuth 2.0, you must install the WooCommerce OAuth2 Plugin.
To install the plugin manually:
- Copy the downloaded folder to the wp-content\plugins folder.
- Activate the plugin through the admin interface's 'Plugins' menu.
Creating and Registering the Application
- Log into your site through the admin panel.
- Navigate to OAuth Server.
- Select Add New Client.
- Fill in all required fields. One of the fields requests that you specify a Callback url for the new client, where the user is redirected after granting access. However, WooCommerce does not perform any validation on the Callback URL, you can specify something like http://localhost:33333.
- Click Create Client. The WooCommerce admin panel displays the following Oauth credentials:
- Client Key: Specify this value when setting the OAuthClientId variable.
- Client Secret: Specify this value when setting the OAuthClientSecret variable.
Record these values for future use.