OpenIdDict 4 (26.12.2022 W) Flashcards
(6 cards)
What if you enable passthrough, but don’t provide action or forget to add MapControllers?
You will receive 404 not found status code
What does SignIn method do in token action of the controller?
It is standard ControllerBase method.
It creates SignInResult which is ActionResult. Receiving it middleware calls HttpContext.SignInAsync().
You have to specify OpenIdDict authentication scheme. It makes middleware passes controll to OpeidDict. Which issues tokens for you.
SignInResult must contain ClaimsPrincipal created by you.
Why OpenIdDict doesn’t include scopes automatically?
OpenIddict has already checked if the requested scopes are allowed (in general and for the current client). The reason why we have to add the scopes manually here is that we are able to filter the scopes granted here if we want to.
How to enable Implicit Flow on server level?
AddServer().AllowImplicitFlow()
Hot to enable AuthorizationCode flow?
AddServer().AllowAuthorizationCodeFlow()
Hot to enable AuthorizationCode flow and require PKCE?
AddServer().AllowAuthorizationCodeFlow().RequireProofKeyForCodeExchange()