What does the term "challenge" mean?
ControllerBase
class has a method Challenge
that returns a class object ChallengeResult
.
CookieAuthenticationOptions
has a property AutomaticChallenge
.
I believe it ChallengeResult
has something to do with external inputs. But how does it work? Where does the term "challenge" come from? What lies inside this.
source to share
A ChallengeResult
is this ActionResult
which, when executed, causes problems with authentication handlers. Or, if none is specified, the default call handler. Source code for ChallengeResult
AutomaticChallenge
(in ASP.NET Core 1.x) is a parameter that says this is the default call handler. This means that it will be called if no identification scheme is assigned.
A challenge is basically a way of saying, "I don't know who this user is, please verify their identity." Therefore, if the authentication handler being triggered is, for example, a Facebook authentication handler, it will respond to the challenge by sending a redirect to the Facebook authentication page. The local account authentication handler can redirect to the local login page.
You can see this in action in the OAuthHandler that Facebook (and Microsoft and Google) auth uses.
source to share