0

I added drupal module "Oauth2" in order to test access by tokens. I created a consumer and got his uuid and client_secret by which I tested, using postman post method, the genretation of my first token,but it failed by 403 access forbidden(see the capture bellow):

error 403

I tried to test a simple connexion (by admin account) to my user login using the post method, but it failed as well (see the capture bellow):

403 with post method

Seems like there is an issue with the post method

PS: I've already enabled POST for my endpoint at /admin/config/services/rest.

Thanks in advance!

  • I'm using Drupal 8.4.5 – developper May 26 '18 at 11:38
0

I eventually figure out what the problem was after many many attempts.

There was actually an issue with postman access to Drupal, it's because Drupal was configured in services.yml to allow access only to Angular API (for my project) by:

Configure requests allowed from specific origins.

allowedOrigins: ['http://localhost:4200']

I changed it to test with postman by:

Configure requests allowed from specific origins.

allowedOrigins: ['*']

Consequently, my token was created in postman with post method which means: bye to 403 error!!!

Hope that can help someone :)

Thank you!

| improve this answer | |

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.