private async Task <bool> SendIntrospectionResponseAsync(OpenIdConnectResponse response) { var request = Context.GetOpenIdConnectRequest(); Context.SetOpenIdConnectResponse(response); response.SetProperty(OpenIdConnectConstants.Properties.MessageType, OpenIdConnectConstants.MessageTypes.IntrospectionResponse); var notification = new ApplyIntrospectionResponseContext(Context, Scheme, Options, request, response); await Provider.ApplyIntrospectionResponse(notification); if (notification.Result != null) { if (notification.Result.Handled) { Logger.LogDebug("The introspection request was handled in user code."); return(true); } else if (notification.Result.Skipped) { Logger.LogDebug("The default introspection request handling was skipped from user code."); return(false); } } Logger.LogInformation("The introspection response was successfully returned: {Response}.", response); return(await SendPayloadAsync(response)); }
/// <summary> /// Represents an event called before the introspection response is returned to the caller. /// </summary> /// <param name="context">The context instance associated with this event.</param> /// <returns>A <see cref="Task"/> that can be used to monitor the asynchronous operation.</returns> public virtual Task ApplyIntrospectionResponse(ApplyIntrospectionResponseContext context) => OnApplyIntrospectionResponse(context);