问题描述
我有一个需要验证多个JWT的用例,我的方法是编写validate-jwt策略,如下所示:
< validate-jwt>
< openid-config url ="@((string)context.Variables [" openIdUrl]))" />
</validate-jwt>
I have a use case where I need to validate multiple JWTs, my approach was to write the validate-jwt policy as follows:
<validate-jwt>
<openid-config url="@((string)context.Variables["openIdUrl"])" />
</validate-jwt>
但是,我收到以下错误,该错误表明验证APIM时无法识别url属性的代码块,并尝试验证文本是否为正确的URI.这一定是一个错误.我唯一能想到的解决方法是硬编码 网址并在选择时"策略内复制validate-jwt策略.对于我的理智而言,这是无法管理/可扩展/有益的.
However I get the following error, which shows that when validating APIM doesn't recognise the code block for the url attribute and attempts to validate that the text is a proper URI. This must be a bug. The only workaround I can think of is to hard code the url and duplicate the validate-jwt policy inside a choose when policy. This is not manageable/scalable/good for my sanity.
第65行第8列的元素"validate-jwt"中的错误:无法从以下位置获取配置:"@((string)context.Variables [" openIdUrl]))". 无法从以下位置检索文档:'@((string)context.Variables ["openIdUrl"])'.提供了无效的请求URI.请求URI必须是绝对URI或必须设置BaseAddress
Error in element 'validate-jwt' on line 65, column 8: Unable to obtain configuration from: '@((string)context.Variables["openIdUrl"])'. Unable to retrieve document from: '@((string)context.Variables["openIdUrl"])'.An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set
推荐答案
< validate-jwt>
< openid-config url =" {{OIDC_ENDPOINT}}"/>
</validate-jwt>
----------------------------------- -------------------------------------------------- ----------
如果此答案有帮助,请单击标记为答案"或上投票".提供额外的 关于您的论坛体验的反馈,请单击 >此处 .
If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here.
这篇关于validate-jwt openid-config URL-如何使用变量作为URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!