question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QS] How to use kcContext for custom implementation

See original GitHub issue

First 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:closed
  • Created 2 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
mRamziicommented, Sep 2, 2021

@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

2reactions
mRamziicommented, Sep 8, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found