# Authentication Failure when using cwmp.auth()

**URL:** <https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820>\
**Category:** Uncategorized\
**Created:** [August 6, 2024, 7:25pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820 "2024-08-06T19:25:42Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 6, 2024, 7:25pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/1 "2024-08-06T19:25:42Z")

</div>

I want to set a specific password for CPEs to connect to the server, I used cwmp.auth() and the value of AUTH(“username”,“password”) and I continuously get authentication failure. I keep getting random devices in the name of “DISCOVERYSERVICE” on my server. How can i solve this problem and how to make my system secure? My db is already NOT connected to NAT, so what can i do other than that??

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 6, 2024, 7:26pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/2 "2024-08-06T19:26:43Z")

</div>

@zaidka @akcoder

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [August 6, 2024, 7:49pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/3 "2024-08-06T19:49:06Z")

</div>

Please don’t abuse the tagging feature. At least wait a day or two before tagging people.

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 6, 2024, 7:54pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/4 "2024-08-06T19:54:16Z")

</div>

sorry but it’s an urgent matter and I have been asking about this for weeks without answers

---

<div class="post-metadata">

**Author:** ![webtron](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/webtron/32/396_2.png) [@webtron](https://forum.genieacs.com/u/webtron)\
**Post date:** [August 7, 2024, 5:57am UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/5 "2024-08-07T05:57:56Z")

</div>

I have mine as the top entry in the Admin \> Config area. The key is cwmp.auth and in Value I have AUTH(“username”, “password”) OR AUTH(“username2”, “password2”) etc.  
I have no brackets in the key and I have a space between the comma and password. Not sure if the space makes a difference or not. There are still some random authentication errors in the logs but it works.

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 8, 2024, 10:27am UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/6 "2024-08-08T10:27:07Z")

</div>

Thank you for your reply, but it didn’t work

---

<div class="post-metadata">

**Author:** ![webtron](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/webtron/32/396_2.png) [@webtron](https://forum.genieacs.com/u/webtron)\
**Post date:** [August 9, 2024, 1:46am UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/7 "2024-08-09T01:46:04Z")

</div>

Reading this I think the key has changed depending on your GenieACS version. [Incorrect connection request credentials (v1.2) - #3 by zaidka](https://forum.genieacs.com/t/incorrect-connection-request-credentials-v1-2/240/3)

```auto
cwmp.connectionRequestAuth

```

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 11, 2024, 5:53pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/8 "2024-08-11T17:53:44Z")

</div>

> [@Discoveryservice devices keep popping up on the devices list](https://forum.genieacs.com/t/discoveryservice-devices-keep-popping-up-on-the-devices-list/5114/6):
>
> Don’t just copy/paste code without understanding what is going on. By settings cwmp.auth to the value you have above, you are telling GenieACS that only CPEs that connect with a username of username and password of password are permitted to connect. What you probably really want is something like this: AUTH(username, password) OR AUTH("usernameSetOnTheCpe", "passwordSetOnTheCpe") This will allow GenieACS to try to auth the CPE using the value stored in the ConnectionRequestUsername/Password p…

Idk but i asked about this before and tried this and still got authentication failure so idk what else to do, but thanks so much for helping

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 13, 2024, 3:10pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/9 "2024-08-13T15:10:44Z")

</div>

Can i tag you now?

---

<div class="post-metadata">

**Author:** ![bjuanico](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/bjuanico/32/1735_2.png) [@bjuanico](https://forum.genieacs.com/u/bjuanico)\
**Post date:** [August 13, 2024, 7:25pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/10 "2024-08-13T19:25:33Z")

</div>

Im using the exact method described earlier.  
Added img for clarification

 ![genieacs](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/6/60398ea12c56413779e164a809ef64754c8de58c.png)

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [August 13, 2024, 7:54pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/11 "2024-08-13T19:54:42Z")

</div>

Sorry @Nirmeen I meant to reply the other day but completely forgot. When you say authentication failure, are you referring to the connection request (e.g. when you click summon)? If that’s the case then `cwmp.auth` config option is irrelevant.

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 13, 2024, 8:10pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/12 "2024-08-13T20:10:06Z")

</div>

It’s okay. Then what should i use to authenticate CPEs? i tried cwmp.auth and cwmp.connectionRequestAuth… after i use cwmp.auth all the devices disconnect and i get authentication failure on cpe.debug file… when i use this cwmp.connectionRequestAuth i still get random devices connected to my server

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [August 14, 2024, 7:33pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/13 "2024-08-14T19:33:47Z")

</div>

The option `cwmp.connectionRequestAuth` authenticates the ACS to the CPE when you trigger a connection request. While `cwmp.auth` authenticates the CPE’s inform messages. From what you’re describing, it sounds like you need `cwmp.auth`. You say all devices disconnect when you use that option so that tells me that your devices don’t have the correct credentials. Try settings the following parameters before you enable auth:

Device.ManagementServer.Username  
Device.ManagementServer.Password

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 16, 2024, 6:39pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/14 "2024-08-16T18:39:41Z")

</div>

Thank you for your answer, i tried setting the correct credentials for the device and then enable cwmp.auth, i still get 401 status code

 ![454675844_3797285337174320_6175274586821522869_n](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/9/9a0c021d06e025480d5901bc9911881ccb70211c.jpeg)

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [August 16, 2024, 7:08pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/15 "2024-08-16T19:08:05Z")

</div>

Assuming you have configured the credentials in the CPE correctly, then this does look like a CPE bug. You should reach out to the manufacturer. It’s also possible that it’s a bug in Genie, but that’s very unlikely unless you can reproduce the issue with different CPEs from different vendors. Let me know if that’s the case.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [August 16, 2024, 7:09pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/16 "2024-08-16T19:09:48Z")

</div>

You can try enabling HTTPS. In HTTPS, Genie should use ‘basic’ auth instead of ‘digest’. Basic is simpler to implement so less likely to have bugs.

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 21, 2024, 1:27pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/17 "2024-08-21T13:27:35Z")

</div>

You mean i should assign an SSL certificate to cwmp using the genieacs.env file or use something else like nginx?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [August 21, 2024, 4:25pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/18 "2024-08-21T16:25:17Z")

</div>

That is all going to depend on how you have things configured. If you are using nginx as a reverse proxy, then you will need to setup the cert there. If you have the CPEs connecting directly to the CWMP process, then you would need to configure the cert stuff in genieacs.env

-dan

---

<div class="post-metadata">

**Author:** ![Nirmeen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nirmeen](https://forum.genieacs.com/u/Nirmeen)\
**Post date:** [August 22, 2024, 12:53pm UTC](https://forum.genieacs.com/t/authentication-failure-when-using-cwmp-auth/5820/19 "2024-08-22T12:53:58Z")

</div>

thank you so much, it worked!
