yuzd / Hangfire.HttpJob

httpjob for Hangfire,restful api for Hangfire,job调度与业务分离
https://github.com/yuzd/Hangfire.HttpJob/wiki
MIT License
630 stars 186 forks source link

New Feature: Allow Pre-Request to get token and include in the Header of the HttpJob. #185

Closed maxiar closed 1 year ago

maxiar commented 1 year ago

Hi! Excelent works with HttpJob Extension! I've a concern, usually a HttpJob invoke a protected endpoint, now it can be solved including the Bearer Token in the Header of the HttpJob (as harcoded value), but usually the token has a expiration time, and after some time that the job fail...

So, exists some way or any workaround to invoke a pre-load funcion some like /api/GetToken(user, pass), in order to retrieve the Bearer token, and add to the header of the new HttpJob on each invocation? o something like that..

I can't disable the security for the endpoint, because it's needed to check the tenant database..

yuzd commented 1 year ago

I've been a bit busy these days. I'll take a look at it on the weekend

yuzd commented 1 year ago

check this: https://github.com/yuzd/Hangfire.HttpJob/wiki/04.Callback%E5%8A%9F%E8%83%BD%7CEL%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%9D%A5%E5%8A%A8%E6%80%81%E6%96%AD%E8%A8%80%E6%89%A7%E8%A1%8C%E6%88%90%E5%8A%9F%E8%BF%98%E6%98%AF%E5%A4%B1%E8%B4%A5#20210610%E6%96%B0%E5%A2%9Espelvardictionary%E9%85%8D%E7%BD%AE

image

image

image

maxiar commented 1 year ago

Excelent! Genious!