...
Steps 1 through 3 are common as mentioned in Configuring an OAuth App with Client Credentials Grant type.
From the Grant type list, select Authorization code.
Specify the details for the client as shown in the image below.
Select Shared secret.
Mandatory. Select Select
offline_access
scope under Scopes.
Note: It is mandatory to selectoffline_access
scope under Scopes to get a refresh token.Click Save. The client Identifier and Secret are generated. You can toggle the Show/Hide link to display and copy the client secret.
...