Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
588 views
in Technique[技术] by (71.8m points)

c# - Unable to set global configuration for AuthenticationOptions and AddHeadersToRequest on ocelot

I'm trying to set a global configuration in the GlobalConfiguration section in the ocelot.json file, I don't want to repeat the same configuration in every request e.g the sub claim is needed in each request so I always want to get it and the same thing for the AuthenticationOptions, I tried to put them in GlobalConfiguration section but I get this info on the console 'message: /api/Employee/CheckEmployeeAccess route does not require user to be authorized' i think this is mean the authentication is not working then I get an error in my internal service because I try to get the headers and it missing the sub header this is my startup file enter image description here and my ocelot.json file enter image description here

note: when I put the AuthenticationOptions AddHeadersToRequest in the Routs section it works fine.

question from:https://stackoverflow.com/questions/65881639/unable-to-set-global-configuration-for-authenticationoptions-and-addheaderstoreq

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...