Can not access node solid development server localhost

Hello everyone. I am new to solid. I’ve been trying to integrate ExpressJS with node solid client using node-solid-client. But when I use the development node solid server using localhost, express can not access the https://localhost:8443 . I am uploading my express server on Docker. My Code is given below

console.log("done");
  try {
    console.log("try ")
    let ses = await client.login({
      idp: YOUR_IDENTITY_PROVIDER, // e.g. https://localhost:8443
      username: "my username",
      password: "my password",
    });
    console.log(ses.isLoggedIn);
    return res.send("hi");
  } catch (error) {
    console.log(error.message);
  }

Instead, it prints the console and ses.isLoggedIn returns false. But if I use https://solidcommunity.net , it works. What could be the error here? Can anybody help please?
My console:
Screenshot from 2021-06-09 11-34-43

Solidcommunity.net is using v5.6.6. Are you using the same version? Do you have version 2.0.5 of solid-node-client? I can’t see enough of the log to figure anything out, can you show more?

I have an account on SolidCommunity.net just. I am using solid-node-client 2.0.4. Actually, my error logs nothing shows more than the screenshot I provided in the post. Another thing, I am running my express server on Docker . My route:

Error:

Ah, I just though of something - have you set solid-node-client as a trustedApp on your localhhost? You’ll need to use the databrowser on the localhost and set https://solid-node-client as a trustedApp. Let me know if that fixes it for you.

I already tried that, but didn’t work.

Hmm, maybe ask your question in the gitter chat room for NSS .

@Tapu106 maybe the require/import of the auth-library doesn’ t work proper, but that’s just a thought from the tip of my head…

Did you mean requiring the node-solid-client part? If that’s the case, I also tested solid community pod. Authentication works just fine. But in the case of my local host, solid server pod doesn’t work. As I’ve given my code and the console part, you can see there isn’t any essential information about the error on the console.

Just in case … could you show the part where you import Solid-Node-Client and create the client object?

Sure. The screenshot is given below:

Well, that looks fine. Maybe, instead of redirecting in your test code above, try to read or write a private file. Perhaps isLoggedIn is giving a false negative.

I’ve consoled my session information.But it returns as “undefined” object.

Off topic, sorry. Not sure if I should ask this in another discussion post. Instead local host I’ve added solid community as pod temporarily. Now I have my webID. How can I retrieve my profile information from webID using solid-node-client? I’ve tried installing rdflib but rdflib is giving error with nodejs 10 in which I am currently working on.

OH! There are several other needed libraries in addition to rdflib that require a minimum of node 12. I’m afraid your only option is to upgrade your node.

Here’s how to retrieve a profile from a WebID using Solid-Node-Client:

/* Follow-Your-Nose (traversal)                                                 
   ----------------------------                                                 
   opens a profile                                                              
   finds the prefernces file in the profile                                     
   opens the preferences file                                                   
   finds the preferred mailbox in the preferences file                          
*/                                                                              
import {SolidNodeClient} from 'solid-node-client';                              
let client = new SolidNodeClient();                                             
import * as $rdf from 'rdflib';                                                 
const kb = $rdf.graph();                                                        
const fetcher = $rdf.fetcher(kb,{fetch:client.fetch.bind(client)});             
                                                                                
const webid = "https://jeff-zucker.solidcommunity.net/profile/card#me";         
const profile = $rdf.sym(webid).doc();                                          
const me = $rdf.sym(webid);                                                     
                                                                                
const foaf = $rdf.Namespace('http://xmlns.com/foaf/0.1/');                      
const pim = $rdf.Namespace('http://www.w3.org/ns/pim/space#');                  
                                                                                
async function main(){                                                          
  await client.login(); // grabs credentials from environ vars                  
  await fetcher.load(profile);                                                  
  let myPrefs = kb.any( me, pim('preferencesFile') );                           
  await fetcher.load(myPrefs);                                                  
  let mbox = kb.any( me,foaf('mbox'));                                          
  console.log(mbox.value);                                                      
}                                                                               
main(); 

Oh…Thank you very much. But how can solve this problem mentioned before. A note, I am accessing localhost:8443 from docker.Is there any issue for this?

The problem is that solid-node-client requires at least version 12 of nodejs. It will not work with version 10, sorry.

Oh sorry. I was talking about the problem I have posted here. How can I access my localhost pod using solid-node-client.?

With the same methods you have used but the correct node version.

Hi! About local NSS. I am not sure about the installation of NSS on my PC. I want to install solid on development environment . That’s why I am using self-signed certificates. I followed Solid server Running in development environments section. Now any specific action I should be concerned about?I followed these steps:

  1. cloned the NSS into my pc.
  2. generated self-signed certificates
  3. in NSS directory, followed commands to setup server
{
  "root": "/home/csepc09/Documents/node-solid-server/data",
  "port": "8443",
  "serverUri": "https://localhost:8443",
  "webid": true,
  "mount": "/",
  "configPath": "./config",
  "configFile": "./config.json",
  "dbPath": "./.db",
  "sslKey": "/home/csepc09/Documents/privkey.pem",
  "sslCert": "/home/csepc09/Documents/fullchain.pem",
  "multiuser": false,
  "server": {
    "name": "localhost",
    "description": "",
    "logo": ""
  }
}
  1. then /bin/solid-test start
    Is there any mistake with my installation? My NSS runs just fine on my localhost.

@jeffz I just noticed that when I started my local NSS pod, it shows “auth-method: oidc”. But I am not using any oidc token. Now I want to try without oidc. How should I proceed?
My screenshot: