0

After getting the token and when I call the rest API I got this error.

User deprecated function: You must set the encryption key going forward to improve the security of this library - see this page for more information https://oauth2.thephpleague.com/v5-security-improvements/ in League\OAuth2\Server\AuthorizationServer->enableGrantType() (line 142 of vendor/league/oauth2-server/src/AuthorizationServer.php).

The error stack trace is the following.

League\OAuth2\Server\AuthorizationServer->enableGrantType(Object, Object) (Line: 118)
Drupal\simple_oauth\Plugin\Oauth2GrantManager->getAuthorizationServer('password') (Line: 50) Drupal\simple_oauth\Controller\Oauth2Token->token(Object) call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscribe\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78) > Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

this is the modules that I used:

  • defuse/php-encryption (v2.2.1)
  • lcobucci/jwt (3.2.4)
  • league/event (2.1.2)
  • league/oauth2-server (5.1.6)
  • drupal/simple_oauth (2.0.0-rc3)

Any help please?

Note: I use : simple_oauth , league/oauth2-server

  • 1
    It's not clear if the error is caused from code you wrote or from a module you are using. In the first case, you need to show the code you are using. In the other case, this is a bug report to do for the module you are using. – kiamlaluno Aug 6 '18 at 16:06
  • I use : simple_oauth , league/oauth2-server – Mohammad Trabelsi Aug 7 '18 at 7:12

Your Answer

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

Browse other questions tagged or ask your own question.