There are many steps for setup simple_oauth module in drupal 8 which are following :
Step 1:- Install simple_oauth module by using the following commands :
a. composer require 'drupal/simple_oauth:^5.0'
b. drush en simple_oauth
Note- You can use any other installation method if your machine does not configure with composer and drush.
Step 2:- Generate a pair of keys to encrypt the tokens. And store them outside of your document root for security reasons. You can use following commands for that :
a. openssl genrsa -out private.key 2048
b. openssl rsa -in private.key -pubout > public.key
c. Save the path to your keys in: /admin/config/people/simple_oauth.
d. Go to REST UI and enable the oauth2 authentication in your resource.
Step 3:- Create a Client Application by going to: /admin/config/services/consumer/add.
Step 4:- Create a token with your credentials by making a POST request to /oauth/token.
Step 5:- (Not shown) Permissions are set to only allow to view nodes via REST with the authenticated user.
Step 6:- Request a node via REST without authentication and watch it fail.
Step 7:- Request a node via REST with the header Authorization: Bearer {YOUR_TOKEN} and watch it succeed.
a. Get Token
b. Request for node view



Very informative post...
ReplyDeleteAbout - How to configure Simple OAuth Module with drupal 8
Will try to configure it...
Drupal Development Company
Drupal Module Development Services
Great Blog with Good Information.
ReplyDeleteDrupal Training in Chennai
Drupal Training in Bangalore