Custom React GUI for oidc-client-js

is there a way to user your custom React GUI with oidc-client-js? I know that if you trigger authentication endpoint using:

            // PopUps might be blocked by the user, fallback to redirect
            try {
                await this.userManager.signinRedirect(this.createArguments(state)); //Shows midleware login form
                return this.redirect();
            } catch (redirectError) {
                console.log("Redirect authentication error: ", redirectError);
                return this.error(redirectError);

Middleware will try to render its predefined login form:

OIDC default form

However I have my own React form and I only need to pass to OICDClient params (email,password) and get back User instance to display UserName etc. Something like:

var loggedUser = await this.userManager.signinCustom(state.loginEmail, state.LoginPassword); //Login using credentials

I don’t want to write all the logic by myself I really want to use all functionality from OIDCClient – only with my GUI (loginForm, registerForm, updateUserForm etc).

I’m using scaffolded library from MSDN using command:

dotnet new react -o <output_directory_name> -au Individual

Is there any method/implementation to initialise oidc-client-js from React components and not user default GUI forms?

Thanks a lot!

Source: React – Stack Overflow

November 28, 2021
Category : News
Tags: | identityserver4 | oauth-2.0 | oidc-client-js | reactjs

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.