使用Azure AD和Oauth2保护.Net Web API [英] Secure .Net Web API with Azure AD and Oauth2

查看:90
本文介绍了使用Azure AD和Oauth2保护.Net Web API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非常简单的场景。

我去了Visual Studio 2015并用EF生成了一个ASP.Net Web API 2,我已经配置了我的SQL db。我知道有创建/读取/更新/删除记录的基本设置。

I went to Visual studio 2015 and generate a ASP.Net Web API 2 with EF and I have configured to work with my SQL db. I know have the basic setup to do Create/Read/Update/Delete records.

我现在想让我的客户端使用我的Web API,但我希望获得某种授权,身份验证机制,所以我用Oauth2查看Azure AD。我想在我的Azure AD中为我的客户端创建一个用户并给他们凭证,这样他们就可以用
来使用oauth2进行身份验证。

I now want to allow my client to consume my web API but I want to have some sort of authorization and authentication mechanism so I look at Azure AD with Oauth2. I want to create a user for my client in my Azure AD and give them the credential so they can use it to authenticate with oauth2.

问题是,没有单引导/教程那里展示如何设置这个东西?! 

Question is, there is not a single guide/tutorial out there that show how to set this thing up?! 

有人可以向我展示一些教程或链接,展示如何使用Web API配置Azure AD吗?

Can someone show me some tutorial or link that show how to configure Azure AD with web API?




推荐答案

嗨TuBong,

Hi TuBong,

要设置Azure AD for ASP.NET应用程序,请查看以下文档。

To set up Azure AD for ASP.NET application, please check the below documentation.

https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-asp-webapp

在上面的链接中,左侧树一步一步显示了设置Azure AD,教程和示例。

In the above link, the left hand side tree showed step by step to set up Azure AD, Tutorials and Samples.

我希望它会有所帮助。


这篇关于使用Azure AD和Oauth2保护.Net Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆