Skip to content

Instantly share code, notes, and snippets.

@guzmonne
Created July 19, 2019 14:20
Show Gist options
  • Save guzmonne/1e518e9d6ac25879f20fcc5a1a2d6b45 to your computer and use it in GitHub Desktop.
Save guzmonne/1e518e9d6ac25879f20fcc5a1a2d6b45 to your computer and use it in GitHub Desktop.
var keycloak;
function init() {
// If the Keycloak constructor doesn't exist we'll throw
// an error.
if (window.Keycloak === undefined) {
throw new Error('Can\'t find Keycloak on the global scope');
}
// Later on the article we'll see what a `realm` and
// a `client` means in Keycloak.
keycloak = new Keycloak({
url: 'http://127.0.0.1:8080/auth',
realm: 'React App',
clientId: 'react-app-1'
});
}
export { keycloak, init };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment