问题描述
我正在尝试Microsoft身份平台的示例代码,以向Web应用程序添加身份验证和授权。 链接(https://github.com/Azure-Samples/ms-identity-aspnet-webapp-openidconnect)中的示例在IIS Express中运行良好。 当我尝试使用IIS中的自定义网站托管同一网站时,它无法正常工作。下面介绍了我所遵循的步骤以及出现的问题。
在IIS Express中托管
自定义IIS网站中的住宿
我无法理解为什么在同一应用程序在IIS Express中运行良好的同时会发生这种情况。 请帮我解决这个问题。 谢谢。
解决方法
在Microsoft azure开发人员支持的帮助下,我能够找到根本原因。 我们必须在redirect-uri值的末尾加上斜杠(/),如下所示。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body>
<table class="table fold-table parent" id="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Designation</th>
<th scope="col">Contact Details</th>
<th scope="col">Email</th>
</tr>
</thead>
<tbody>
<tr class="view">
<td col="Name">John</td>
<td col="Designation">[email protected]</td>
<td col="Contact Details">
<span class="contactInfo">
<img class="contact mr-2" src="./assets/call.png" />35373726<br>
<img class="contact mr-2" src="./assets/call.png" />35373726
</span>
</td>
<td col="Email">[email protected]<img class="expand ml-2" src="arrow.png" /></td>
</tr>
<tr class="fold">
<td colspan="4">
<div class="fold-content">
<table class="child">
<tbody>
<tr>
<td col="Name">SUB Category 1</td>
<td col="Designation">SUB Category 2</td>
<td col="Contact Details">SUB Category 3</td>
<td col="Email">[email protected]
</td>
</tr>
<tr>
<td col="Name">SUB Category 1</td>
<td col="Designation">SUB Category 2</td>
<td col="Contact Details">SUB Category 3</td>
<td col="Email">[email protected]
</td>
</tr>
<tr>
<td col="Name">SUB Category 1</td>
<td col="Designation">SUB Category 2</td>
<td col="Contact Details">SUB Category 3</td>
<td col="Email">[email protected]
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tbody>
</table>
</body>
在用于AD的azure门户中,对于相应的应用程序,您应该具有相同的redirect-uri值。