2

I have successfully installed the Simple OAuth module on my website. I am also able to authenticate to it using Postman. I am getting the access_token and the refresh_token when authenticating. However, am not able to figure out how I can use this token to access Drupal's default REST endpoints or the endpoints provided by JsonAPI module.

I tried sending the token in the header with Authorization as key and Bearer {{the token }} as the value with no success. What is the right way to use the token for communicating with Drupal?

0

Just follow the steps given in https://dev.acquia.com/blog/decoupled-drupal-authentication-oauth-20, once you get the access token in postman you will also see tokens for the user details you have given at admin/config/people/simple_oauth/oauth2_token. Just copy the access token from postman and add it to Access Token field of Authorization tab(New version of Postman) by selecting Type as oauth2 (Dont't use the access token from the path given above).

Also make sure in permission page under RESTful Web Services section you will see your custom api listed and permission for authenticated user was given.

I followed the same and it worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.