# Announcing Solid-Node-Client

**URL:** https://forum.solidproject.org/t/announcing-solid-node-client/3541
**Category:** General Discussion
**Created:** [October 28, 2020, 5:11pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541 "2020-10-28T17:11:46Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![bourgeoa](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/bourgeoa/32/291_2.png) [@bourgeoa](https://forum.solidproject.org/u/bourgeoa)
#### Post date: [November 14, 2020, 9:17pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/21 "2020-11-14T21:17:42Z")

</div>

Solid-file-client has functions to programmatically build and manage acl content with validation.

Can help if you need more documentation than the README.

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 1, 2020, 3:30pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/22 "2020-12-01T15:30:40Z")

</div>

Hey @jeffz

I’m also trying to use solid-auth-client in a project.  
a node.js  
But when I try to use a custom log-in, I get a TypeError:

```
(node:36065) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of null
    at Object.getAuthFetcher (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-auth-fetcher/dist/obtainAuthHeaders.js:11:29)
    at SolidNodeClient.<anonymous> (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:100:67)
    at step (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:33:23)
    at Object.next (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:14:53)
    at fulfilled (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

```

I’m just trying to log-in with

```
session = await client.login({
            idp: "https://inrupt.net",
            username: "<appropriate username>",
            password: "<appropriate password>",
            debug: true
        });

```

Can you help please?

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 1, 2020, 3:43pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/23 "2020-12-01T15:43:55Z")

</div>

also when I installed solid-node-client I got  
┌──────────────────────────────────────────────────────────────────────────────┐  
│ Manual Review │  
│ Some vulnerabilities require your attention to resolve │  
│ │  
│ Visit [https://go.npm.me/audit-guide](https://go.npm.me/audit-guide) for additional guidance │  
└──────────────────────────────────────────────────────────────────────────────┘  
┌───────────────┬──────────────────────────────────────────────────────────────┐  
│ High │ Prototype Pollution in node-forge │  
├───────────────┼──────────────────────────────────────────────────────────────┤  
│ Package │ node-forge │  
├───────────────┼──────────────────────────────────────────────────────────────┤  
│ Patched in │ \>= 0.10.0 │  
├───────────────┼──────────────────────────────────────────────────────────────┤  
│ Dependency of │ solid-node-client │  
├───────────────┼──────────────────────────────────────────────────────────────┤  
│ Path │ solid-node-client \> solid-auth-fetcher \> node-jose \> │  
│ │ node-forge │  
├───────────────┼──────────────────────────────────────────────────────────────┤  
│ More info │ [https://npmjs.com/advisories/1561](https://npmjs.com/advisories/1561) │  
└───────────────┴──────────────────────────────────────────────────────────────┘  
Is that normal?

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 1, 2020, 5:12pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/24 "2020-12-01T17:12:34Z")

</div>

Did you do the second step of the installation - set [https://solid-node-client](https://solid-node-client) as a trustedApp in your profile? See the link in the README if you don’t know how to do that. Please let me know if this solves your problem.

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 1, 2020, 5:18pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/25 "2020-12-01T17:18:05Z")

</div>

NPM often reports audit issues in downstream libraries. Run “npm audit fix” after the install and some vulnerabilities may disappear. If they don’t you can ignore them or manually install a new version of the vulnerable library (in this case node-forge).

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 1, 2020, 5:42pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/26 "2020-12-01T17:42:38Z")

</div>

Hi,

I added it to trusted, as can be seen in this screenshot, before I posted on the forum.

To no avail.

 ![addedtitrusted](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/8/85da2ea2c7a1048dab6a11139824302f83f4d72c.png)

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 1, 2020, 5:46pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/27 "2020-12-01T17:46:16Z")

</div>

There can’t be a slash at the end of the trustedApp, remove it and it should work. If that turns out to fix it, I’ll add a warning to the README.

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 2, 2020, 9:16am UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/28 "2020-12-02T09:16:37Z")

</div>

Hi, still having the same problem after removing the trailing slash.

 ![addedtitrusted_1](https://europe1.discourse-cdn.com/flex017/uploads/solidproject/original/2X/8/8a9233b657d460a607b3afbeb8032a7382e2a409.png)  
the output with printout of idp and username

```
idpUrl: https://inrupt.net
username: johansolid
(node:124553) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of null
    at Object.getAuthFetcher (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-auth-fetcher/dist/obtainAuthHeaders.js:11:29)
    at SolidNodeClient.<anonymous> (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:100:67)
    at step (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:33:23)
    at Object.next (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:14:53)
    at fulfilled (/mnt/70D8F8E6D8F8AC0A/Documents/courses/stage/projects/nodeSolidAPI/node_modules/solid-node-client/src/index.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

```

and the used code

```
solid.client = new solid.solidClient();

            console.log(`idpUrl: ${idpUrl}`);
            console.log(`username: ${username}`);
            let session = await solid.client.login(
                {
                    idp: idpUrl,
                    username: username,
                    password: password
                });
```

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 2, 2020, 10:27am UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/29 "2020-12-02T10:27:56Z")

</div>

Ok, I created a webID on [solidcommunity.net](http://solidcommunity.net) and did the exact same thing.  
There it **did** work.  
Even with a trailing slash.

So I’m thinking that there’s a difference between how inrupt and solidcommunity manage their logins?  
The cookie?

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 2, 2020, 2:06pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/30 "2020-12-02T14:06:34Z")

</div>

No, both [inrupt.net](http://inrupt.net) and [solidcommunity.net](http://solidcommunity.net) run NSS with the same login process. Also I am able to login to both servers with solid-node-client. Are you positive you are using the correct username/password? Do you have the most recent version of solid-node-client?

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 2, 2020, 5:45pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/31 "2020-12-02T17:45:25Z")

</div>

Ah, I found the problem:

It was my password…  
It ended with an ampersand.  
Changed it to something else, problem solved …

Thanks for the help!  
I knew it was going to be something stupid, automatically generated passwords, …  
And the trailing slash apparently doesn’t matter in the trusted applications.

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 2, 2020, 5:47pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/32 "2020-12-02T17:47:39Z")

</div>

Ah, good, you had me worried :-). I am looking at putting in some try/catches so that the user gets a better error message when that happens.

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 3, 2020, 4:50am UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/33 "2020-12-03T04:50:03Z")

</div>

Hi @jeffz.  
I’m sorry, but there seems to be a misunderstanding.  
The problem isn’t my password as such, but any password ending with an ampersand.

I changed my password on the idp to one ending without an ampersand  
eg. Password987654321!  
And the login works  
but with a password like  
Password987654321&  
the above mentioned error is still there.

So anybody using a password ending with an ampersand is going to have the same problem.

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 3, 2020, 4:58am UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/34 "2020-12-03T04:58:10Z")

</div>

@johan may I ask, what is the behavior in a browser login with a password ending in ampersand? If it also denies it, then you should file a bug with Node-Solid-Server suggesting that they reject passwords ending in ampersand when they are created. If it works in the browser but not from the command line, I need to delve deeper.

---

<div class="post-metadata">

### Author: ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.solidproject.org/u/johan)
#### Post date: [December 3, 2020, 5:00am UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/35 "2020-12-03T05:00:07Z")

</div>

I’m sorry to say that in a browser the password ending in ampersand gives no error.

---

<div class="post-metadata">

### Author: ![jeffz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/jeffz/32/600_2.png) [@jeffz](https://forum.solidproject.org/u/jeffz)
#### Post date: [December 3, 2020, 5:04am UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/36 "2020-12-03T05:04:09Z")

</div>

OK, that means work for me. Thanks for finding it. (really)

---

<div class="post-metadata">

### Author: ![Naveen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/naveen/32/2060_2.png) [@Naveen](https://forum.solidproject.org/u/Naveen)
#### Post date: [March 21, 2021, 4:35pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/37 "2021-03-21T16:35:02Z")

</div>

Hey @bourgeoa @jeffz  
I am trying to add solid node client as a trusted app using solid file client.  
I am having trouble updating the trusted app to the acl file of https:///profile/card#me. It would be helpful if you could point me to the format that can be used to update the trusted app for the same.  
I have tried updating it using the “fc.acl.addUserMode”, but the acl file gets corrupted when i do the same

---

<div class="post-metadata">

### Author: ![bourgeoa](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/bourgeoa/32/291_2.png) [@bourgeoa](https://forum.solidproject.org/u/bourgeoa)
#### Post date: [March 21, 2021, 5:01pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/38 "2021-03-21T17:01:57Z")

</div>

You should not edit the profile/card.acl `You may break your pod`

It is not clear what you are trying to :

- trusted app is the root part of an app url : `https://test.com` if the app you want use is `https://test.com/test.html`
- the trusted app is added in https://“yourpod”/profile/card : you should use mashlib to add one using the preferences pane.
- on certain situation where you want to limit your app on a certain container/resource it may be added to the container/resource acl. For that specific usage the trusted app in your profile/card must exist with no authorization.

---

<div class="post-metadata">

### Author: ![Naveen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/naveen/32/2060_2.png) [@Naveen](https://forum.solidproject.org/u/Naveen)
#### Post date: [March 21, 2021, 5:10pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/39 "2021-03-21T17:10:55Z")

</div>

I am developing an application using solid-node-client. Since solid-node-client has to be added as a trusted app before it can be used for authorized fetches, i am trying to add solid-node-client as a trusted app at the time of registration using a browser library or other auth clients so the user need not go through the extra step of adding a trusted app through the preference pane.  
Is there any way this can be accomplished?

---

<div class="post-metadata">

### Author: ![Naveen](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/naveen/32/2060_2.png) [@Naveen](https://forum.solidproject.org/u/Naveen)
#### Post date: [March 21, 2021, 5:13pm UTC](https://forum.solidproject.org/t/announcing-solid-node-client/3541/40 "2021-03-21T17:13:48Z")

</div>

@bourgeoa Any other way solid-node-client can be added as a trusted app in NSS by default without having to do it through the preference pane would be appreciated.

[Previous page](https://forum.solidproject.org/t/announcing-solid-node-client/3541.md?page=1)

[Next page](https://forum.solidproject.org/t/announcing-solid-node-client/3541.md?page=3)
