Skip to content

Part-DB returns 500 error when attempting to authenticate with DigiKey #581

@elegantiron

Description

@elegantiron

Describe the bug
I can't authenticate with DigiKey's API. I am able to complete all necessary steps, but when submitting the log-in information, I am redirected to Part-DB, which throws a 500 internal server error.

To Reproduce
Steps to reproduce the behavior:

  1. Set up new installation (including all database migrations)
  2. Configure DigiKey API (I had existing API credentials from another application)
  3. Attempt to perform OAuth

Expected behavior
DigiKey's API OAuth toekn is stored.

Screenshots
image

Server Side

  • Part-DB Version: 1.11.3 (official Docker image)
  • PHP Version: 8.1.27 (SAPI: fpm-fcgi)
  • Database Server: SQLite

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox
  • Version: 124.0.1 (64-bit)
{"message":"Uncaught PHP Exception InvalidArgumentException: \"Required option not passed: \"access_token\"\" at AccessToken.php line 96","context":{"exception":{"class":"InvalidArgumentException","message":"Required option not passed: \"access_token\"","code":0,"file":"/var/www/html/vendor/league/oauth2-client/src/Token/AccessToken.php:96","trace":["/var/www/html/vendor/league/oauth2-client/src/Provider/AbstractProvider.php:844","/var/www/html/vendor/league/oauth2-client/src/Provider/AbstractProvider.php:642","/var/www/html/vendor/knpuniversity/oauth2-client-bundle/src/Client/OAuth2Client.php:108","/var/www/html/src/Controller/OAuthClientController.php:60","/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:181","/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:76","/var/www/html/vendor/symfony/http-kernel/Kernel.php:197","/var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35","/var/www/html/vendor/autoload_runtime.php:29","/var/www/html/public/index.php:5"]}},"level":500,"
level_name":"CRITICAL","channel":"request","datetime":"2024-03-30T13:41:54.205101+00:00","extra":{"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"admin"},"url":"/en/oauth/client/ip_digikey_oauth/check?code=XdAJZGBG&scope=&state=94ff677b0db35fc5a470cdd66eec9d7d","ip":"216.186.168.51","http_method":"GET","server":"inv.caprod.net","referrer":"https://inv.caprod.net/"}}
{"message":"Stored the security token in the session.","context":{"key":"_security_main"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2024-03-30T13:41:54.211449+00:00","extra":{"token":{"authenticated":true,"roles":["ROLE_USER"],"user_identifier":"admin"},"url":"/en/oauth/client/ip_digikey_oauth/check?code=XdAJZGBG&scope=&state=94ff677b0db35fc5a470cdd66eec9d7d","ip":"216.186.168.51","http_method":"GET","server":"inv.caprod.net","referrer":"https://inv.caprod.net/"}}
172.18.0.1 - - [30/Mar/2024:13:41:53 +0000] "GET /en/oauth/client/ip_digikey_oauth/check?code=XdAJZGBG&scope=&state=94ff677b0db35fc5a470cdd66eec9d7d HTTP/1.1" 500 4277 "https://inv.caprod.net/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0"
- -  30/Mar/2024:13:41:53 +0000 "GET /index.php" 500

Steps Attempted

  1. Reloading the page
  2. Going back and trying again
  3. Clearing server cache
  4. Clearing browser cache
  5. Clearing both browser and server caches before retrying
  6. Resetting Part-DB to full pristine condition (delete all persistent data; remove container; recreate)
  7. Setting and unsetting DigiKey's OAuth2 Callback URL
  8. Repeating all above steps, but this time using a new Private Browsing Session each time
  9. Single, simple attempt using Microsoft Edge instead of Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions