Created
August 21, 2020 03:45
-
-
Save alicek106/506b162af4eabc0e5a2b88749c9f89fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const React = require("react") | |
const Keycloak = require("keycloak-js") | |
const { KeycloakProvider } = require("@react-keycloak/web") | |
const keycloak = new Keycloak({ | |
realm: 'alicek106', | |
url: 'https://auth.alicek106.com/auth', | |
clientId: 'react-frontend', | |
}) | |
const Loading = () => <div>getting ready...</div> | |
exports.wrapRootElement = ({ element }) => { | |
return ( | |
<KeycloakProvider | |
keycloak={keycloak} | |
initConfig={{ | |
promiseType: "native", | |
onLoad: "check-sso", | |
checkLoginIframe: false, | |
pkceMethod: "S256", | |
silentCheckSsoRedirectUri: | |
window.location.origin + "/silent-check-sso.xhtml", | |
}} | |
LoadingComponent={<Loading />} | |
> | |
{element} | |
</KeycloakProvider> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment