-
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
I need to access Cookies and Query Params inside of my handler.
I found that from the official documentation about triggercontexts that there is a way of accessing some parameters of HttpContext via IContextProvider injection which works like below code and it is very handy.
internal class CallbackHttpRequestHandler : CommandHandlerBase<CallbackHttpRequestDto, IActionResult>
{
private readonly IContextProvider _contextProvider;
public CallbackHttpRequestDtoHandler(IContextProvider contextProvider) : base(false)
{
_contextProvider = context;
}
protected override async Task<IActionResult> ExecuteAsync(CallbackHttpRequestDto request, IActionResult previousResult)
{
if (_contextProvider.HttpContext != null)
{
var headers = _context.HttpContext.Headers;
var requestUrl = _context.HttpContext.RequestUrl;
var claimsPrincipal = _context.HttpContext.ClaimsPrincipal;
}
}
}
But there is no mapping between original HttpRequest Cookies collections and I need it.
How can I achieve that? I found it not easy inside the SDK to pass this Cookies collection. Please help.
Also posted here on SO
Metadata
Metadata
Assignees
Labels
No labels