# Where to put credentials PPPoE

**URL:** <https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025>\
**Category:** Uncategorized\
**Created:** [September 8, 2020, 2:16pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025 "2020-09-08T14:16:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 8, 2020, 2:16pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/1 "2020-09-08T14:16:32Z")

</div>

Hi,

for the autoprovsion where I need to write my credentials PPoE ,so that the CPE goes to get them?

Thank you in advance for the support

---

<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:** [September 8, 2020, 5:14pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/2 "2020-09-08T17:14:56Z")

</div>

> **[genieacs/genieacs](https://github.com/genieacs/genieacs/wiki/Example-of-a-Provisioning-Flow)**
>
> A fast and lightweight TR-069 Auto Configuration Server (ACS) - genieacs/genieacs

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 8, 2020, 5:30pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/3 "2020-09-08T17:30:19Z")

</div>

Yes, I have already take these 2 piece of code but then I have this fault:

NAME:  
SyntaxError

MESSAGE:  
Unexpected token \< in JSON at position 0

STACK:  
SyntaxError: Unexpected token \< in JSON at position 0  
at JSON.parse ()  
at IncomingMessage. (/usr/lib/node\_modules/genieacs/config/ext/cpe-config.js:35:31)  
at emitNone (events.js:111:20)  
at IncomingMessage.emit (events.js:208:7)  
at endReadableNT (\_stream\_readable.js:1064:12)  
at \_combinedTickCallback (internal/process/next\_tick.js:139:11)  
at process.\_tickCallback (internal/process/next\_tick.js:181:9)

---

<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:** [September 8, 2020, 6:10pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/4 "2020-09-08T18:10:49Z")

</div>

Well, without seeing what data is actually being returned by what ever your cpe-config script is getting the data from none of us will be able to help you…

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 9, 2020, 7:26am UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/5 "2020-09-09T07:26:02Z")

</div>

But where does the cpe-config data come from?

`const API_URL = process.env.API_URL || 'https://your-host.com/api';`

in place of ‘[https://your-host.com/api](https://your-host.com/api)’ what I need to put?

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 9, 2020, 7:33am UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/6 "2020-09-09T07:33:01Z")

</div>

I do not know if I have explained myself well, but I would like to understand from where the cpe gets the pppoe credentials, where should I put them?  
In order to get them and push them with my provision script

Thank you for your time

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 9, 2020, 1:52pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/7 "2020-09-09T13:52:46Z")

</div>

I have this fault :  
{ uri: ‘[https://0.0.0.0/api/ResetPPPoECreds?serial=48575443677B5B9E&productClass=EG8145V5&oui=00259E](https://0.0.0.0/api/ResetPPPoECreds?serial=48575443677B5B9E&productClass=EG8145V5&oui=00259E)’,  
serial: ‘48575443677B5B9E’ }  
args  
{ ‘0’:  
{ Error: connect ECONNREFUSED 0.0.0.0:443  
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)  
errno: ‘ECONNREFUSED’,  
code: ‘ECONNREFUSED’,  
syscall: ‘connect’,  
address: ‘0.0.0.0’,  
port: 443 } }

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 9, 2020, 4:09pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/8 "2020-09-09T16:09:53Z")

</div>

Someone could kindly help me?

---

<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:** [September 9, 2020, 5:27pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/9 "2020-09-09T17:27:30Z")

</div>

At this point, it appears you are just slinging together code bits you’ve found without understanding how to make all the pieces work together. This is not a good scenario. I’m all for helping people, but you need to have a foundation in how all the pieces of the puzzle work together.

I highly suggest you engage @zaidka and pay for commercial support.

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 9, 2020, 5:53pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/10 "2020-09-09T17:53:59Z")

</div>

I know… I’m so sorry for this but I’m only asking you like other people where is the problem because it isn’t so simple to learn in a few days how everything works, and at work they rush me and I am completely new to this environment. I was hoping for your help

---

<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:** [September 9, 2020, 6:15pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/11 "2020-09-09T18:15:36Z")

</div>

At this point, what you need is more than help on a forum. You need paid, professional help. I do not have enough hours in the day currently to offer professional services. This is why its best to engage with @zaidka.

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 9, 2020, 6:33pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/12 "2020-09-09T18:33:36Z")

</div>

Ok, someone else could help me?

Thanks

---

<div class="post-metadata">

**Author:** ![Rocket78](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/rocket78/32/267_2.png) [@Rocket78](https://forum.genieacs.com/u/Rocket78)\
**Post date:** [September 9, 2020, 8:47pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/13 "2020-09-09T20:47:06Z")

</div>

The example scripts are nothing but mere examples to show you how to start to build your own auto-provisioning service. They are just a provisioning script executing the ext-script which by itself queries a website for the device’s credentials. It assumes that you know how to return a JSON object from a web-query of a script _you_ built. IT isn’t always just copy & paste.

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 10, 2020, 10:30am UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/14 "2020-09-10T10:30:48Z")

</div>

Ok guys, now my provision script works but I only would to kindly ask someone (if you don’t feel like it, I understand) how to get the configuration returned. Because the script does not return a config.  
The config must be the JSON object you speak of?

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 10, 2020, 10:38am UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/15 "2020-09-10T10:38:17Z")

</div>

```
ActionController::RoutingError (No route matches [GET] "/ResetPPPoECreds"):
  
actionpack (5.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:22:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.1) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.1) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.1) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.1) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.1) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.5) lib/rack/method_override.rb:22:in `call'
rack (2.0.5) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.1) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.5) lib/rack/sendfile.rb:111:in `call'
railties (5.2.1) lib/rails/engine.rb:524:in `call'
rack (2.0.5) lib/rack/urlmap.rb:68:in `block in call'
rack (2.0.5) lib/rack/urlmap.rb:53:in `each'
rack (2.0.5) lib/rack/urlmap.rb:53:in `call'
puma (3.12.0) lib/puma/configuration.rb:225:in `call'
puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
puma (3.12.0) lib/puma/server.rb:472:in `process_client'
puma (3.12.0) lib/puma/server.rb:332:in `block in run'
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'
2020-09-10T10:38:04.192Z [INFO] x.x.x.x 00259E-EG8145V5-48575443677B5B9E: Script: No config returned from API
Redirected to http://...devices/00259E-EG8145V5-48575443677B5B9E
Completed 302 Found in 1547ms (ActiveRecord: 0.0ms)
```

---

<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:** [September 10, 2020, 3:38pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/16 "2020-09-10T15:38:07Z")

</div>

You haven’t gotten your provisioning script working. You have pointed it to the GenieACS web UI.

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 10, 2020, 4:02pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/17 "2020-09-10T16:02:58Z")

</div>

Yes, but now I tried to write a small JSON which I pass to my ext script.  
My ext script is trivial :

```
function getConf(args, callback) {

    let json = require('/.../config/ext/cpe-config.json')

    console.log('Returning credentials to client', json);
    return callback(null, json);

}

exports.getConf = getConf;

```

and now there is on the log:

```
Returning credentials to client { CustomerCode: { CodiceCliente: 4545645 },
  Name: { Nome: 'boh' },
  SerialNumber: { SerialNumber: '48575443677B5B9E' },
  'PPPoE-Username': { username: 'jaid@fdni },
  'PPPoE-Password': { password: 'iequ2Aizee' } }
```

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 10, 2020, 4:06pm UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/18 "2020-09-10T16:06:09Z")

</div>

Now there is something that works, or am I wrong?

---

<div class="post-metadata">

**Author:** ![encarta](https://avatars.discourse-cdn.com/v4/letter/e/e19b73/32.png) [@encarta](https://forum.genieacs.com/u/encarta)\
**Post date:** [September 15, 2020, 6:45am UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/19 "2020-09-15T06:45:43Z")

</div>

the returned json structure is not match with the one which is referred by provisioning script.

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 15, 2020, 7:49am UTC](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025/20 "2020-09-15T07:49:29Z")

</div>

I changed my json in something easier but I don’t know how filter by SerialNumber from the provision script for pushing the right pppoe

[Next page](https://forum.genieacs.com/t/where-to-put-credentials-pppoe/1025.md?page=2)
