在部署到Azure Web App后,重定向URI不匹配。

huangapple go评论100阅读模式
英文:

Redirect uri mismatch after deploying on Azure Web App

问题

我有一个链接到托管在Azure Web应用上的我的应用程序,该链接重定向到Azure B2C自定义注册页面。我已将托管域添加到重定向URL中,即使以斜杠/结尾,也添加到应用程序的重定向URI中。但仍然出现不匹配错误。有任何想法为什么会发生这种情况?

链接如下:
https://xyz.azurewebsites.net/some_url_defined_in_rest_api?attrs=some_data

这将访问API,在检查some_data以进行验证后,将重定向到B2C注册页面。

此外,在Azure Web应用中,我已配置了REST API的虚拟路径如下:
在部署到Azure Web App后,重定向URI不匹配。

我需要添加该虚拟路径吗?
https://xyz.azurewebsites.net/some.virtual.path

英文:

I have a link to my app hosted on Azure Web app which redirects to Azure B2C custom registration page. I have added the hosted domain to redirect urls even with ending / slashes into Application's Redirect URIs. But still gets the mismatch error. Any idea why is it happening?

link is like:
https://xyz.azurewebsites.net/some_url_defined_in_rest_api?attrs=some_data

This will hit the API and after checking some_date for validation it will redirect to the b2c registration page

Also in Azure Web App I have configured a virtual pat the REST API as:
在部署到Azure Web App后,重定向URI不匹配。

Do I need to add that virtual path too?
https://xyz.azurewebsites.net/some.virtual.path

答案1

得分: 1

虚拟路径不需要包含在重定向URI中,除非它明确是应传递给Azure B2C的URL的一部分。

如果Azure Web应用程序中的重定向URL包括特定路径,如/example_url_in_rest_api,则必须在Azure B2C应用程序注册中的应用程序重定向URI中包含相同的URL。检查是否存在任何查询参数,并在URL的一部分时将它们添加进去。

从应用程序中删除重定向URI,然后重新添加它。有时,这可能有助于解决问题。

通过以下方式检查B2C租户应用程序:

路径: Azure AD B2C >> 打开查询 >> 运行B2C查询列表

如果问题仍然存在,您可以尝试使用类似Fiddler(用于调试Web应用程序)的工具监视应用程序和Azure AD B2C之间的HTTP流量。这可以帮助您识别与重定向URI或其他配置设置相关的任何问题。

英文:

The virtual path is not required to be included in the Redirect URIs unless it is specifically part of the URL that should be passed on to Azure B2C.

If the redirect URL in an Azure Web App includes a specific path like /example_url_in_rest_api, you must include that same URL in the Application's Redirect URIs in your Azure B2C application registration. Check for any query parameters are present and add those if they are part of the URL.

Remove the redirect URI from your application and re-add it. Sometimes, it may help in resolving the issue.

Check the B2C tenant applications by going to Azure resource Graph query as shown below:

Path: Azure AD B2C >> Open a query >> Run the B2C list of queries.

在部署到Azure Web App后,重定向URI不匹配。

If still the issue persists, you can try monitoring the HTTP traffic between your application and Azure AD B2C with a tool like Fiddler (for debugging web applications). This could help you to identify any issues with the redirect URI or other configuration settings.

huangapple
  • 本文由 发表于 2023年5月25日 22:37:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76333492.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定