[QS] How to use kcContext for custom implementation
See original GitHub issueFirst of all thanks a lot for creating this package, it might just be a lifesaver for people like us.
I am trying to make use of keycloakify with custom Material UI login screen.
From the source code, I can see that in the example template, you have created your own login page
I see in this login page you are making use of kcContext, which help maintain the values state.
Is there any documentation on how to use kcContext for any custom implementation. If not can you guide me in the right direction and I will more than happy make it possible.
Appreciate your help.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12
Top Results From Across the Web
Context Propagation in Quarkus
Context Propagation in Quarkus · Solution · Setting it up · Usage example with Mutiny · Usage example for CompletionStage · Overriding which...
Read more >Using React context with a custom hook
Here's a basic implementation for a color mode context with a custom context hook: import React, { useContext } from 'react' const ColorModeContext...
Read more >Use Context and Custom Hooks to share user state ... - Fatma Ali
Extending the implementation ... First, let's move the context into its own file for better readability. ... Here, we've created a wrapper to...
Read more >How to change the value of a Context with useContext?
You can create a component, use the hook, and utilize the context values without any issues. What I'm not certain about is how...
Read more >How to use React Context effectively - Kent C. Dodds
How to create and expose React Context providers and consumers. ... First, the useCount custom hook uses React.useContext to get the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@shubhamdeodia It’s actually very simple to implement, as @garronej mentionned, you are just rendering the page with react, and your context has everything you need to create custom pages.
That is exactly what I did, fully customized React pages for my website, just grab a hold of the {url, login, register …} in the KcContext, and use them to submit forms to interact with Kc, just like Kc does
@shubhamdeodia You can set the authentication flow on the realm to require OTP, then add a custom page “login-config-totp.ftl”
You can take the base page here as an example and implement it in React.
Also checkout the part where you need to declare custom pages and additionnal context nodes for types in TS.