-
I want to get authentication token by calling IAuthentication.Login(username,password) I use this code for my DI
|
Beta Was this translation helpful? Give feedback.
Answered by
canton7
Jul 5, 2021
Replies: 1 comment 1 reply
-
You've basically got two options:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mhmmdsmdi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You've basically got two options:
IUserApi
. In this case, you'll need to assign that property for every instance ofIUserApi
which is created. There's nothing built-in to let you do this, so you'll have to registerIUserApi
with the IoC container yourself (without usingUseWithRestEaseClient
), and add the necessary code to assign to that Authentication header.HttpMessageHandler
. You can then register that, using e.g..AddHttpClient("...").ConfigurePrimaryHttpMessageHandler(...).UseWithRestEaseClient<IUserApi>()
.