.Net Authentication Flashcards

1
Q

Can you specify different schemes for different actions?

A

Yes. You can specify different default schemes to use for authenticate, challenge, and forbid actions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an authentication handler?

A

Is a type that implements the behavior of a scheme.

Is derived from IAuthenticationHandler or AuthenticationHandler<TOptions>.</TOptions>

Has the primary responsibility to authenticate users.

There is also more extended handlers like IAuthenticationSignOutHandler, IAuthenticationSignInHandler, IAuthenticationRequestHandler. They add SignOut, SignIn, HandleRequest actions for scheme.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What authorization handler constructs when authorization is successful?

A

Construct an AuthenticationTicket object representing the user’s identity if authentication is successful.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What authorization handler returns when authorization is not successful?

A

Return ‘no result’ or ‘failure’ if authentication is unsuccessful.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is RemoteAuthenticationHandler<TOptions>?</TOptions>

A

RemoteAuthenticationHandler<TOptions> is the class for authentication that requires a remote authentication step. When the remote authentication step is finished, the handler calls back to the CallbackPath set by the handler.</TOptions>

The handler finishes the authentication step using the information passed to the HandleRemoteAuthenticateAsync callback path. OAuth 2.0 and OIDC both use this pattern. JWT and cookies don’t since they can directly use the bearer token and cookie to authenticate.

That can be used for logging in with Google or Facebook, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly