Skip to content

Instantly share code, notes, and snippets.

@kmikulski
Created June 7, 2018 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmikulski/e0d34a62488642093502aa0ded88a904 to your computer and use it in GitHub Desktop.
Save kmikulski/e0d34a62488642093502aa0ded88a904 to your computer and use it in GitHub Desktop.
the description for this gist
const keycloak = Keycloak({
realm: "MyDemo",
auth-server-url: "http://localhost:8080/auth",
ssl-required: "external",
resource: "my-react-client",
public-client: true,
confidential-port: 0
});
@anodynos
Copy link

anodynos commented Feb 4, 2019

You need quotes around keys with dashes - eg 'ssl-required' - so:

const keycloak = Keycloak({
  realm: 'MyDemo',
  'auth-server-url': 'http://localhost:8080/auth',
  'ssl-required': 'external',
  resource: 'my-react-client',
  'public-client': true,
  'confidential-port': 0
});

@jannes-io
Copy link

jannes-io commented Sep 17, 2019

If I use a JS object I get an error.

const keycloak = Keycloak({
  realm: 'master',
  'auth-server-url': 'https://[redacted]/auth',
  'ssl-required': 'external',
  resource: '[redacted]',
  'public-client': true,
  'confidential-port': 0,
});

error:
uncaught exception: clientId missing

trace:

loadConfig keycloak.js:723
    init keycloak.js:137
    value index.js:397
    value index.js:378

any idea?
@anodynos @kmikulski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment