IConnectionUserRefreshFeature.OnUserRefreshed Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Registers a callback to be invoked after the User has been refreshed.
public IDisposable OnUserRefreshed(Action<System.Security.Claims.ClaimsPrincipal,object?> callback, object? state);
abstract member OnUserRefreshed : Action<System.Security.Claims.ClaimsPrincipal, obj> * obj -> IDisposable
Public Function OnUserRefreshed (callback As Action(Of ClaimsPrincipal, Object), state As Object) As IDisposable
Parameters
- callback
- Action<ClaimsPrincipal,Object>
The callback to invoke with the refreshed principal and associated state.
- state
- Object
The state to pass to callback.
Returns
An IDisposable that can be disposed to unregister the callback.
Remarks
Callbacks should be quick and avoid blocking; the callback is invoked on the thread that performed the update. Exceptions thrown from callbacks are not propagated to the caller of the update. The previous principal is intentionally not exposed because its underlying resources (for example a WindowsIdentity's SafeHandle) may be disposed when the authentication-refresh request completes, making later access unsafe.