
Huynh VanH.98841 (Customer) asked a question.
Hi team,
I am facing with the error, as picture.
This is log error:
2025/02/09 15:52:40.108+07:00 Error -- ADC(5) -- Could not fetch a new access token
2025/02/09 15:52:40.108+07:00 Info -- ADC at Okta.Api.RestClient.OnResponseError(String url, HttpWebRequest request, HttpWebResponse response)
at Okta.Api.RestClient.OnResponseError(HttpWebRequest request, HttpWebResponse resp)
at Okta.Api.RestClient.DoRequest(String method, Uri uri, String requestBody, String contentType, String accept, Encoding encoding)
at Okta.Api.RestClient.FormPost(String accept, Dictionary`2 formParams, UriTemplate template, String[] args)
at Okta.Api.Authentication.JwtAuthenticationProvider.GetAccessToken()
at Okta.Api.Authentication.JwtAuthenticationProvider.<GetAccessTokenAsync>b__25_0()
Okta.Api.OktaApiException received with message Unexpected status code 400 BadRequest for URL https://demo-blue-barracuda-76687.okta.com/oauth2/v1/token Source=OktaWebAPI InnerException=.
2025/02/09 15:52:40.108+07:00 Error -- ADC(1) -- Error registering agent: One or more errors occurred.
2025/02/09 15:52:40.108+07:00 Info -- ADC at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Okta.Api.Authentication.JwtAuthenticationProvider.CreateHeaders(String method, Uri uri)
at Okta.Api.RestClient.MakeRequest(String method, Uri uri)
at Okta.Api.RestClient.RequestObject(String method, Object obj, XmlSerializer inputSerializer, XmlSerializer outputSerializer, UriTemplate template, Nullable`1 timeout, Boolean supportEncryption, String[] args)
at Okta.Api.RestClient.PostObjectWithReturnedObject(Object obj, XmlSerializer inputSerializer, XmlSerializer outputSerializer, UriTemplate template, String[] args)
at Okta.Api.OktaApi.UpdateAgent(String instanceId, String agentId, RSA agentKey, AgentKeyUsage keyUsage)
at Okta.Agent.Installation.AgentCli.ConfigCli.RegisterAgent(Boolean virtualAgent)
System.AggregateException received with message One or more errors occurred. Source=mscorlib InnerException=Okta.Api.OAuthException: Could not fetch a new access token ---> Okta.Api.OktaApiException: Unexpected status code 400 BadRequest for URL https://demo-blue-barracuda-76687.okta.com/oauth2/v1/token
at Okta.Api.RestClient.OnResponseError(String url, HttpWebRequest request, HttpWebResponse response)
at Okta.Api.RestClient.OnResponseError(HttpWebRequest request, HttpWebResponse resp)
at Okta.Api.RestClient.DoRequest(String method, Uri uri, String requestBody, String contentType, String accept, Encoding encoding)
at Okta.Api.RestClient.FormPost(String accept, Dictionary`2 formParams, UriTemplate template, String[] args)
at Okta.Api.Authentication.JwtAuthenticationProvider.GetAccessToken()
at Okta.Api.Authentication.JwtAuthenticationProvider.<GetAccessTokenAsync>b__25_0()
--- End of inner exception stack trace ---
at Okta.Api.Authentication.JwtAuthenticationProvider.<GetAccessTokenAsync>b__25_0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute().
Caused by Okta.Api.OAuthException received with message Could not fetch a new access token Source=OktaWebAPI InnerException=Okta.Api.OktaApiException: Unexpected status code 400 BadRequest for URL https://demo-blue-barracuda-76687.okta.com/oauth2/v1/token
at Okta.Api.RestClient.OnResponseError(String url, HttpWebRequest request, HttpWebResponse response)
at Okta.Api.RestClient.OnResponseError(HttpWebRequest request, HttpWebResponse resp)
at Okta.Api.RestClient.DoRequest(String method, Uri uri, String requestBody, String contentType, String accept, Encoding encoding)
at Okta.Api.RestClient.FormPost(String accept, Dictionary`2 formParams, UriTemplate template, String[] args)
at Okta.Api.Authentication.JwtAuthenticationProvider.GetAccessToken()
at Okta.Api.Authentication.JwtAuthenticationProvider.<GetAccessTokenAsync>b__25_0().
Caused by Okta.Api.OktaApiException received with message Unexpected status code 400 BadRequest for URL https://demo-blue-barracuda-76687.okta.com/oauth2/v1/token Source=OktaWebAPI InnerException=.
2025/02/09 15:55:39.208+07:00 Info -- ADC(1) -- Agent configuration utility started
2025/02/09 15:55:39.223+07:00 Info -- ADC(1) -- Version: 3.19.0-874-220f611
2025/02/09 15:55:39.286+07:00 Info -- ADC(1) -- Updated System.Net.ServicePointManager.SecurityProtocol=Tls12
2025/02/09 15:55:39.286+07:00 Info -- ADC(1) -- Updated System.Net.ServicePointManager.EnableDnsRoundRobin=True
2025/02/09 15:55:39.302+07:00 Info -- ADC(1) -- Forwarding this request to the agent service
2025/02/09 15:55:39.302+07:00 Error -- ADC(1) -- Unexpected error: Could not forward this request to the agent service
2025/02/09 15:55:39.302+07:00 Info -- ADC at Okta.Agent.Installation.ConfigurationClient.Run(String[] args, IReadOnlyDictionary`2 envVars)
at Okta.Agent.Installation.AgentCli.ConfigCli.Execute(ConfigurationScope scope, String[] args)
Okta.Agent.Installation.ConfigurationServiceException received with message Could not forward this request to the agent service Source=OktaAgentService InnerException=System.InvalidOperationException: Service Okta AD Agent was not found on computer '.'. ---> System.ComponentModel.Win32Exception: The specified service does not exist as an installed service
--- End of inner exception stack trace ---
at System.ServiceProcess.ServiceController.GenerateNames()
at System.ServiceProcess.ServiceController.get_ServiceName()
at System.ServiceProcess.ServiceController.GenerateStatus()
at System.ServiceProcess.ServiceController.get_Status()
at Okta.Agent.Installation.ConfigurationClient.Run(String[] args, IReadOnlyDictionary`2 envVars).
Caused by System.InvalidOperationException received with message Service Okta AD Agent was not found on computer '.'. Source=System.ServiceProcess InnerException=System.ComponentModel.Win32Exception (0x80004005): The specified service does not exist as an installed service.
Caused by System.ComponentModel.Win32Exception received with message The specified service does not exist as an installed service Source= InnerException=.
2025/02/09 15:55:40.614+07:00 Info -- ADC(1) -- Agent configuration utility started

Hello @Huynh VanH.98841 (Customer) Thank you for posting on our Community page!
There has been a similar question asked on our forum previously, please see the question and answer below:
https://support.okta.com/help/s/question/0D54z0000AKEJpxCQH/okta-ad-agent-error-registering-agent-one-or-more-errors-occurred?language=en_US
Thank you for reaching out to our Community and have a great day!
--
Help others in the community by liking or hitting Select as Best if this response helped you.
I checked according to this article but could not solve the error
Is there a chance the Okta AD Agent cannot reach Okta? I'm seeing 400 bad request frequently.
when i install OktaADAgentSetup-3.17.0-850-40493ad.exe it works fine. when I install OktaADAgentSetup-3.20.0-900-53cda30.msi it reports an error like the picture above I sent. I tried checking all the requirements but still not working.
im guessing its either a permission issue on the server or it could be a firewall connectivity issue. the logs are stating the agent can't get a token back from okta. maybe check the okta system log to see if there were any token errors there. but usually as long as the authentication information for the service account are accurate then the token comes back