import "./App.css"; import logo from "./logo.svg"; import myimg from "./myimg.png"; import { OidcProvider, useOidc, getKeycloakAccountUrl } from "./oidc"; export default function App() { return ( // To integrate Keycloak to your React App you have many options such as: // - https://www.npmjs.com/package/keycloak-js // - https://github.com/authts/oidc-client-ts // - https://github.com/authts/react-oidc-context // In this starter we use oidc-spa instead // It's a new library made by us, the Keycloakify team. // Check it out: https://github.com/keycloakify/oidc-spa ); } function ContextualizedApp() { const { isUserLoggedIn, login, logout, oidcTokens } = useOidc(); return (
{isUserLoggedIn ? ( <>

Hello {oidcTokens.decodedIdToken.name} !

Link to your Keycloak account ) : ( ) } logo test_image

Hello world

Check out all keycloak pages in the Storybook!

Once you've identified the ones you want to customize run npx eject-keycloak-page

); } function Jwt(){ const { oidcTokens } = useOidc({ assertUserLoggedIn: true }); // NOTE: Use `Bearer ${oidcTokens.accessToken}` as the Authorization header to call your backend // Here we just display the decoded id token return (
            {JSON.stringify(oidcTokens.decodedIdToken, null, 2)}
        
); }