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

AddSolrNet doesn't implement HttpWebRequestFactory injection #563

Open
nbernier opened this issue Jul 6, 2021 · 4 comments
Open

AddSolrNet doesn't implement HttpWebRequestFactory injection #563

nbernier opened this issue Jul 6, 2021 · 4 comments

Comments

@nbernier
Copy link

nbernier commented Jul 6, 2021

Our Solr instances are protected with the JWT Authentication. The connections needs a valid http header JWT in the HttpClient. The HttpClient is exposed but once the http authorization header is added, there is no way to refresh it. Exposing the HttpWebRequestFactory will give the possibility to refresh the http header token when needed.

@mausch
Copy link
Member

mausch commented Jul 6, 2021

You should be able to use a HttpMessageHandler? e.g. https://stackoverflow.com/a/49304655/21239

@nbernier
Copy link
Author

nbernier commented Jul 7, 2021

Probably but I do not build the HttpClient. I can't inject anything in the constructor.

var connection = new AutoSolrConnection(cores.Single().Url);

@mausch
Copy link
Member

mausch commented Jul 15, 2021

@mausch
Copy link
Member

mausch commented Jul 19, 2021

Sorry, got a similar question when I posted that gist but I notice now that this one is for SimpleInjector and it's a bit diferent too.
I'm not familiar with SimpleInjector, surely there's some way to replace a component? Maybe this https://docs.simpleinjector.org/en/latest/howto.html#override-existing-registrations
Look to replace the component for the ISolrConnection interface.

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