currently we already using oauth2 authentication type for fetching our mailbox (IMAPTLS)
but lil bit confused about token status column that always show
- Last token request failed.
- Last(Refresh) token request failed.

and when i click for request new token its always show errors like this

with detailed error :
Code: Select all
Backend ERROR: OTRS-CGI-23 Perl: 5.30.0 OS: linux Time: Mon Feb 27 20:19:26 2023
Message: Error requesting token for token config ID 3 with authorization code 'XXXXXXXXXX RANDOM TOKEN XXXXXXXXXX'. Error: invalid_request
RemoteAddress: xxxxxxx
RequestURI: /otrs/get-oauth2-token-by-authorization-code.pl?code=XXXXXXXXXX RANDOM TOKEN XXXXXXXXXX&state=TokenConfigID3&session_state=XXXXXXXXXXXXXXXXXXXX
Traceback (2522383):
Module: Kernel::Output::HTML::Layout::Error Line: 1038
Module: Kernel::Output::HTML::Layout::ErrorScreen Line: 1019
Module: Kernel::Modules::AdminOAuth2TokenManagement::_RequestTokenByAuthorizationCode Line: 120
Module: Kernel::Modules::AdminOAuth2TokenManagement::Run Line: 53
Module: Kernel::System::Web::InterfaceAgent::Run Line: 1144
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_get_2doauth2_2dtoken_2dby_2dauthorization_2dcode_2epl::handler Line: 52
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32


any help will be appreciate.
Thank you