DEV Community

Discussion on: Keycloak Express Openid-client

Collapse
 
austincunningham profile image
Austin Cunningham

Hi David I can reproduce your error with the Keycloak server not running so you may not be running it on the default port

npm start 

> keycloak-express-openid-client@1.0.0 start
> node index.js

node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^

Error: connect ECONNREFUSED 127.0.0.1:8080
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 8080
}
npm notice 
npm notice New major version of npm available! 8.11.0 -> 9.6.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.1
npm notice Run npm install -g npm@9.6.1 to update!
npm notice 
Enter fullscreen mode Exit fullscreen mode

This makes sense as Keycloak's default port is 8080
Started up the keycloak server and was able to get it running

 npm start          

> keycloak-express-openid-client@1.0.0 start
> node index.js

Discovered issuer http://localhost:8080/realms/keycloak-express {
  claim_types_supported: [ 'normal' ],
  claims_parameter_supported: true,
  grant_types_supported: [
    'authorization_code',
    'implicit',
    'refresh_token',
    'password',
    'client_credentials',
    'urn:ietf:params:oauth:grant-type:device_code',
    'urn:openid:params:grant-type:ciba'
  ],
  ...
  require_pushed_authorization_requests: false,
  pushed_authorization_request_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/ext/par/request',
  mtls_endpoint_aliases: {
    token_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/token',
    revocation_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/revoke',
    introspection_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/token/introspect',
    device_authorization_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/auth/device',
    registration_endpoint: 'http://localhost:8080/realms/keycloak-express/clients-registrations/openid-connect',
    userinfo_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/userinfo',
    pushed_authorization_request_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/ext/par/request',
    backchannel_authentication_endpoint: 'http://localhost:8080/realms/keycloak-express/protocol/openid-connect/ext/ciba/auth'
  }
}
Listening at http://localhost:3000
Enter fullscreen mode Exit fullscreen mode