OAuthIdentity
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.2.0.0)
The identity of a user signed in through OAuthClient. Derives from ClaimsIdentity, so it satisfies IIdentity for free and reports IsAuthenticated as true simply because its authentication type is never empty — which is exactly what IsAuthenticated reads.
4.2.0+- C#
- VB.NET
public class OAuthIdentity : ClaimsIdentity
Public Class OAuthIdentity
Inherits ClaimsIdentity
No access token, refresh token or ID token is a member of this class, and it holds no reference back to the component. It can therefore be assigned to User, logged, bound to a grid or handed to another layer with nothing sensitive riding along. Code that needs a bearer token calls GetAccessToken. Provider-specific data travels as claims rather than as invented properties, and role checks work through the role claim type. On .NET 8 the same principal can be handed to ASP.NET Core cookie sign-in unchanged.
Properties
AuthenticatedAt
DateTimeOffset: Returns when this identity was created, in UTC.
DisplayName
String: Returns the display name, or null: "name", then the claim type that supplies Name - the descriptor's name claim, or the one type a ProviderResolved handler assigned to NameClaimType - then "preferred_username". For GitHub that claim type is "login", so name falling back to login. Computed at construction: an Authenticating handler that replaces the "name" claim changes what FindFirst("name") returns, not this value.
Email
String: Returns the email address, or null. This is always the provider's own "email" claim, read at construction: nothing writes a chosen display name into it, even on Google, whose default name claim is "email", and an Authenticating handler's claim edits do not change it.
EmailVerified
Boolean: Returns whether the provider asserts the email is verified. Google reports email_verified; GitHub reports the verified flag on the primary email; GitLab reports email_verified for the user's public email and nothing when there is none; Entra is always false, because it makes no such assertion; a custom provider reports email_verified.
FamilyName
String: Returns the family name, or null.
GivenName
String: Returns the given name, or null.
Issuer
String: Returns the validated issuer of the ID token, or the provider's issuer.
Picture
String: Returns the picture or avatar URL, or null.
Provider
OAuthProvider: Returns the provider that authenticated this user.
RawIdTokenClaims
Object: Returns the raw ID token payload as a DynamicObject, or null.
RawUserInfo
Object: Returns the raw userinfo document as a DynamicObject, or null.
Subject
String: Returns the provider's stable identifier for this user: Google sub, GitHub id, Entra oid, GitLab sub, custom sub. Also present as a NameIdentifier claim.
TenantId
String: Returns the Entra tid claim, or the Google hd claim, or null.