我创建了一个API应用并将其部署到Azure。该应用程序使用Active Directory身份验证。
我收到以下错误信息:
AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: 00000000-0000-4f27-0000-00000000.
目前为止的步骤
- 启用了Active Directory身份验证
- 设置CORS为*
- 将回复URL设置为相同地址https://myapp.azurewebsites.net/
我已在web config中添加了以下设置
config
<add key="ida:AADInstance" value="https://login.microsoftonline.com/{0}"></add>
<add key="ida:PostLogoutRedirectUri" value="https://myapp.azurewebsites.net/"></add>
这个API的代码如下:
[HttpGet]
[SwaggerResponse(HttpStatusCode.OK,
Type = typeof(IEnumerable<Contact>))]
public async Task<IEnumerable<Contact>> Get()
{
return await GetContacts();
}