# Authenticaton error installing APM Agent

**URL:** <https://discuss.elastic.co/t/authenticaton-error-installing-apm-agent/335455>\
**Category:** Elastic Agent\
**Tags:** elastic-stack-security\
**Created:** [June 7, 2023, 5:56pm UTC](https://discuss.elastic.co/t/authenticaton-error-installing-apm-agent/335455 "2023-06-07T17:56:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcos\_Ivan\_Robles\_H](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcos_ivan_robles_h/32/121557_2.png) [@Marcos\_Ivan\_Robles\_H](https://discuss.elastic.co/u/Marcos_Ivan_Robles_H)\
**Post date:** [June 7, 2023, 5:56pm UTC](https://discuss.elastic.co/t/authenticaton-error-installing-apm-agent/335455/1 "2023-06-07T17:56:12Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** :

**Elasticsearch version** : 8.6.0

**APM Server version** :

**APM Agent language and version** : 8.6.0 C#

**Browser version** :

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Windows download form quickstart

**Fresh install or upgraded from other version?**  
Fresh

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers?

Nothing special

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

I'm trying to install APM Agent on my local to connect with my company dev elastic environment.  
I did it successfully with 2 personal elastic trial accounts. Just following the quick start with cloud.

But with my company elastic-kibana dev environment I got the following error when installing the APM agent from windows console:

```auto
{"log.level":"info","@timestamp":"2023-06-07T10:51:08.152-0600","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":407},"message":"Generating self-signed certificate for Fleet Server","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-06-07T10:51:10.522-0600","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":803},"message":"Fleet Server - Starting: spawned pid '142512'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2023-06-07T10:51:14.537-0600","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":803},"message":"Fleet Server - Error - info fail [401 Unauthorized] {\"error\":{\"root_cause\":[{\"type\":\"security_exception\",\"reason\":\"unable to authenticate with provided credentials and anonymous access is not allowed for this request\",\"additional_unsuccessful_credentials\":\"oauth2 token: invalid token\",\"header\":{\"WWW-Authenticate\":[\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\",\"Bearer realm=\\\"security\\\"\",\"ApiKey\"]}}],\"type\":\"security_exception\",\"reason\":\"unable to authenticate with provided credentials and anonymous access is not allowed for this request\",\"additional_unsuccessful_credentials\":\"oauth2 token: invalid token\",\"header\":{\"WWW-Authenticate\":[\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\",\"Bearer realm=\\\"security\\\"\",\"ApiKey\"]}},\"status\":401}","ecs.version":"1.6.0"}
Error: fleet-server failed: context canceled

```

**Steps to reproduce** :

1. Go to management tab -\> Fleet
2. Click Add Fleet Server button
3. Choose Quickstart
4. Click Continue with default Fleet Server Host
5. Copy windows power shell script  
6.Execute it

**Errors in browser console (if relevant)**:  
No  
**Provide logs and/or server output (if relevant)**:

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2023, 5:56pm UTC](https://discuss.elastic.co/t/authenticaton-error-installing-apm-agent/335455/2 "2023-07-05T17:56:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
