【问题标题】:Auth Azure with php使用 php 对 Azure 进行身份验证
【发布时间】:2018-01-04 20:49:05
【问题描述】:

我正在尝试使用 microsoft azure 进行身份验证,我已经在 Azure 门户等一些地方注册了我的应用程序,y 是在 easyauth.azurewebsites.net 中注册应用程序的链接,甚至在这里是 apps.dev.microsoft。 com,然后我在我的代码中复制 de App Id,我也在尝试使用 Graph API 进行身份验证,并使用一些 Outlook 服务连接到使用lampp的本地应用程序,并且该应用程序位于 php.ini 中。 当我注册应用程序时,我使用 url localhost/app/app.php

这是我正在尝试使用简单身份验证的代码

 <script src="jquery-3.2.1.js"  type="text/javascript"></script>
 <script type="text/javascript">
  $(document).ready(function(){
    $("#theButton").on('click',function(){

        AzureADAuth.getAccessToken()
            .then(function(token){
                alert(token);
            })
            .error(function(err){
                alert("something gone wrong") 
            });
    });
});

【问题讨论】:

  • 您遇到了什么具体问题?是否要从 PHP Web 应用程序连接到 Azure Active Directory?如果是,请参考这个thread

标签: azure oauth-2.0 azure-web-app-service azure-active-directory azure-ad-graph-api


【解决方案1】:

我没有看到一个确切的问题,所以我只会给你一个一般性的答案。要支持 Azure AD(工作或学校帐户)或 Microsoft 帐户(outlook、xbox、hotmail),您可以在 App Registration Portal 中注册您的应用程序。然后,您需要通过创建应用程序密码/密码并设置重定向 URI 来配置此应用程序。

然后您可以将应用程序与一些 OAuth2.0 库集成。我有written a small PHP sample using the phpleague OAuth2.0 client,您可以为此结帐。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-14
    • 2017-04-08
    • 2018-04-06
    相关资源
    最近更新 更多