简体   繁体   English

Microsoft Stream SSO 以编程方式与 Azure AD

[英]Microsoft Stream SSO with Azure AD programmatically

I know that is possible to configure the Azure AD SSO between Office 365 portals, but how can I do it programmatically?我知道可以在 Office 365 门户之间配置 Azure AD SSO,但我如何以编程方式进行配置?

Are there any ways in local ASP.NET web application to authenticate a user in Azure AD programmatically using username/password without prompt Azure AD logon screen, get a token and then redirect to Microsoft Stream page with the user authenticated?在本地 ASP.NET web 应用程序中是否有任何方法可以在不提示 Azure AD 登录屏幕的情况下使用用户名/密码以编程方式对 Azure AD 中的用户进行身份验证,获取令牌,然后重定向到 Microsoft Stream 页面并通过用户身份验证?

I cannot find this functionality in Microsoft Graph API and the Microsoft Stream API are in development.我在 Microsoft Graph API 中找不到此功能,而 Microsoft Stream API 正在开发中。

You can use this (resource owner password credential) flow to log in with specific user/pass https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc however, this will get you a token for azure ad app, I don't think it will work on the office 365 portals / stream portal though you can try it.您可以使用此(资源所有者密码凭据)流程以特定用户/密码登录https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc但是,这将给你一个 azure 广告应用程序的令牌,我认为它不会在 Office 365 门户网站/stream 门户网站上运行,但你可以尝试一下。 It's mainly for accessing apis and aad applications.主要用于访问api和aad应用。 but feel free to give it a try, its the only way to authenticate with user/pass without interaction that I'm aware of.但请随意尝试一下,这是我知道的唯一无需交互即可通过用户/密码进行身份验证的方法。

You can use ROPC Flow to get the token which helps in authenticate to Microsoft Stream without login popup.您可以使用ROPC Flow获取令牌,这有助于在没有登录弹出窗口的情况下向Microsoft Stream进行身份验证。

Here is the request for your reference:以下是供您参考的请求:

POST {tenant}/oauth2/v2.0/token
Host: login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded

client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&scope=user.read%20openid%20profile%20offline_access
&username=MyUsername@myTenant.com
&password=SuperS3cret
&grant_type=password

Note: Microsoft recommends you do not use the ROPC flow.注意: Microsoft 建议您不要使用 ROPC 流程。 In most scenarios, more secure alternatives are available and recommended.在大多数情况下,可以使用并推荐更安全的替代方案。 This flow requires a very high degree of trust in the application, and carries risks which are not present in other flows.此流程需要对应用程序有非常高的信任度,并且会带来其他流程中不存在的风险。 You should only use this flow when other more secure flows can't be used.您应该仅在无法使用其他更安全的流程时才使用此流程。

Based on the above note it advises using client credential flow .根据上面的说明,它建议使用client credential flow Please refer similar question with client credential flow that may help you请参考与客户端凭证流程类似的问题,这可能对您有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM