OAuthAuthenticatingEventArgs
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
Provides data for the Authenticating event: the authorization decision point, before the user becomes User. An organization or team membership check belongs here, and so does claim editing: Identity is a ClaimsIdentity, so add, remove or remap claims on it — Entra groups, GitHub organization or team membership, custom fields — and add roles by assigning new OAuthPrincipal(e.Identity, roles) to Principal. Claims edited here are visible to FindFirst, HasClaim and IsInRole; the identity's computed Email, DisplayName and TenantId were read at construction and do not change. Follows the Validating precedent. Vetoing with Cancel discards this attempt only — nothing is stored — and does not end a sign-in already in effect: a handler that rejects a user who has just been disabled must call SignOut itself.
- C#
- VB.NET
public class OAuthAuthenticatingEventArgs : CancelEventArgs
Public Class OAuthAuthenticatingEventArgs
Inherits CancelEventArgs
Properties
Identity
OAuthIdentity: Returns the identity that was built.
Principal
IPrincipal: Returns or sets the principal to assign. Defaults to a new OAuthPrincipal wrapping Identity. Assign new OAuthPrincipal(e.Identity, roles) to add role claims of the identity's role claim type, which is always "roles", or another principal type. The same object is delivered on Principal and, when SetApplicationUser is true, becomes User. Null is not allowed: to refuse the user set Cancel, and to leave User alone set SetApplicationUser to false.
Throws:
- ArgumentNullException The value is null.
Provider
OAuthProvider: Returns the provider that authenticated the user.
Reason
String: Returns or sets the text surfaced as ErrorDescription when Cancel is true.
SetApplicationUser
Boolean: Returns or sets whether User is assigned. Pre-filled true, or false when an already authenticated host principal would be overwritten (the component logs why). A handler may set it either way: back to true to replace the host principal knowingly, or to false for a second component that only collects API tokens and must not touch the signed-in user — the identity is still stored on Identity.
Used By
| Name | Description |
|---|---|
| OAuthAuthenticatingEventHandler | Represents the method that handles the Authenticating event. 4.2.0+ |