Active Directory 帐户的 Oauth 2 令牌
Oauth 2 token for Active Directory accounts
我过去曾使用 Owin 在我的 Mvc Web Api 项目中创建令牌端点以提供具有“Resource Owner Password Credentials”授权类型[=32 的 oauth 2.0 令牌=] 其中访问令牌提供商将检查数据库用户 table 以验证移动客户端提供的凭据的有效性(使用 Visual Studio 工具为 Cordova 开发的多平台应用程序)。
在此项目中,Web Api 将由 Active Directory Windows 域帐户
使用的多平台移动应用程序使用
我想使用 Owin Oauth 2.0 向这些用户授予访问令牌,但我不知道如何检查这些凭据的有效性。
我在想的是将 /token
端点放在 "basic authentication"
后面,并在访问令牌提供程序的代码中从身份中获取用户,如果使用身份验证,应该是由 Asp.net 管道自动创建。
这东西有用吗?
您知道为 AD Windows 帐户使用 Oauth 2.0 的更好方法吗?
注:
我也在调查 Active Directory 是否能够自行提供 Oauth 2.0 端点。
您可以在 AD 之上使用 ADFS 3.0,这将为您提供 OAuth 2.0 授权服务器功能:http://blog.scottlogic.com/2015/03/09/OAUTH2-Authentication-with-ADFS-3.0.html
将令牌端点放在 "basic authentication" 后面对您没有帮助,因为您将在令牌端点而不是用户上验证客户端。不过,您可以将授权端点放在 "basic authentication" 后面。
这里有一个关于如何使用 Active Directory 联合身份验证服务获取 OAuth2 令牌的很好的演练。
https://technet.microsoft.com/en-us/library/dn633593.aspx。
您必须点击底部的所有链接才能获得整个演练。
注意这里指的是使用Windows Azure AD Authentication Library for .NET。但根据该文档,该库同时用于 Azure Active Directory 和本地 Active Directory。
至于工作流程,一旦通过身份验证,您将能够获取不记名令牌并将其提供给您的 WebAPI。然后您的 WebAPI "validates the signature of the token to ensure it was issued by AD FS, checks to see if the token is still valid and hasn’t expired and may possibly also validate other claims in the token. At this point, the client is either authorized and the information they requested is sent in the response or they are unauthorized and no data will be sent." - https://technet.microsoft.com/en-us/library/dn633593.aspx
我过去曾使用 Owin 在我的 Mvc Web Api 项目中创建令牌端点以提供具有“Resource Owner Password Credentials”授权类型[=32 的 oauth 2.0 令牌=] 其中访问令牌提供商将检查数据库用户 table 以验证移动客户端提供的凭据的有效性(使用 Visual Studio 工具为 Cordova 开发的多平台应用程序)。
在此项目中,Web Api 将由 Active Directory Windows 域帐户
使用的多平台移动应用程序使用我想使用 Owin Oauth 2.0 向这些用户授予访问令牌,但我不知道如何检查这些凭据的有效性。
我在想的是将 /token
端点放在 "basic authentication"
后面,并在访问令牌提供程序的代码中从身份中获取用户,如果使用身份验证,应该是由 Asp.net 管道自动创建。
这东西有用吗?
您知道为 AD Windows 帐户使用 Oauth 2.0 的更好方法吗?
注:
我也在调查 Active Directory 是否能够自行提供 Oauth 2.0 端点。
您可以在 AD 之上使用 ADFS 3.0,这将为您提供 OAuth 2.0 授权服务器功能:http://blog.scottlogic.com/2015/03/09/OAUTH2-Authentication-with-ADFS-3.0.html
将令牌端点放在 "basic authentication" 后面对您没有帮助,因为您将在令牌端点而不是用户上验证客户端。不过,您可以将授权端点放在 "basic authentication" 后面。
这里有一个关于如何使用 Active Directory 联合身份验证服务获取 OAuth2 令牌的很好的演练。 https://technet.microsoft.com/en-us/library/dn633593.aspx。 您必须点击底部的所有链接才能获得整个演练。
注意这里指的是使用Windows Azure AD Authentication Library for .NET。但根据该文档,该库同时用于 Azure Active Directory 和本地 Active Directory。
至于工作流程,一旦通过身份验证,您将能够获取不记名令牌并将其提供给您的 WebAPI。然后您的 WebAPI "validates the signature of the token to ensure it was issued by AD FS, checks to see if the token is still valid and hasn’t expired and may possibly also validate other claims in the token. At this point, the client is either authorized and the information they requested is sent in the response or they are unauthorized and no data will be sent." - https://technet.microsoft.com/en-us/library/dn633593.aspx