Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new configs available on UserManager #673

Closed
VysockyStan opened this issue Jul 21, 2021 · 5 comments
Closed

Add support for new configs available on UserManager #673

VysockyStan opened this issue Jul 21, 2021 · 5 comments

Comments

@VysockyStan
Copy link

Hello,
oidc-client library added this one

  • client_authentication [1.11.0] (default: client_secret_post): Indicates when sending client secret if sent as a post param or in Authorization header using HTTP Basic (use client_secret_basic).

And I really need it in my current project.
Could you please add it to the UserManager config

@simenandre
Copy link
Member

Hey! Thanks for reporting this, and thanks for using oidc-react! 🙏

You can use your own UserManager for this, let me give you an example:

import React from 'react';
import { UserManager, AuthProvider } from 'oidc-react';

const userManager = new UserManager({
 // ... set your config here
});

export const HelloComponent: React.FC = () => (
	<AuthProvider userManager={userManager}>
	{/* ... */}
	</AuthProvider>
);

Let me know if that works for you! 🚀

@VysockyStan
Copy link
Author

VysockyStan commented Jul 22, 2021

Thanks for reply
Yeh, I've tried that but UserManager doesn't have definition for that exact prop.
OidcClient neither has

This causes TS error
new UserManager({ client_authentication: 'client_secret_basic' })

And this
new UserManager({ clientAuthentication: 'client_secret_basic' })

@VysockyStan
Copy link
Author

Hello, could you please inform me if you are going to add that prop or not.

Thanks

@simenandre
Copy link
Member

This would be something I'd normally recommend you open an issue over at oidc-client-js, since this is not really something wrong with this particular library. However, as we are tracking in #652, the library is deprecated. We are trying to work out which path to go, but until then I'd recommend you do type-casting when using Typescript.

E.g. like this: new UserManager({ clientAuthentication: 'client_secret_basic' } as any)

@VysockyStan
Copy link
Author

Thank you very much!
That works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants