Extend LocalAuthenticationContext
To login a user aside from username and password I need additional parameter like company id. So I have decided to make a custom login service and implement AuthenticateLocalAsync. However the problem is that LocalAuthenticationContext does not allow to pass custom parameters. So is there a way to pass additional data to AuthenticateLocalAsync ?
There is no AuthenticateLocalAsync anymore. Do whatever you need to authenticate a user - but you do it yourself.
Interesting. Could you please point me to the direction where to look for this. What should be used instead of AuthenticateLocalAsync now ?
Just have a look at the host project and follow the code path on the login page.
Am I right that in IdentityServer4 the UI is completely decoupled from the library, and we always need to copy-paste from the sample project?
You are right about the decoupling - but our plan is to provide the standard UI as a nuget package.
Thanks @leastprivilege it looks like this approach simplifies the integration a lot. Am I right to conclude that IdentityServer4 doesn't really care about how you validate the credentials and what is the database structure. As long as you populate claims and pass it in ClaimsPrincipal it will know all it needs to know.
Yes you are right.
Could you please elaborate on what needs to be customized in identity server in order for the custom parameter (e.g.: company-id) to propagate from the client to the login page as a separate parameter?
The request will look like this: Authorize request: /connect/authorize?client_id=my-client&...&company-id=my-company Login Page request: /account/login?returnUrl=/connect/authorize/login?...&company-id=my-company
I see the redirect to the login page is done on LoginPageResult.ExecuteAsync. To add there a new custom query string parameter I guess i should provide an custom implementation for this class, right? How to inject this custom implementation?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.