检索身份验证信息Azure AD

时间:2016-03-07 17:30:09

标签: php azure active-directory ms-office office365

如何使用php从Azure AD检索身份验证联系信息(用于注册的电话号码)? Azure API新手,需要简要说明吗?

2 个答案:

答案 0 :(得分:2)

您可以使用此终端调用Graph API来获取用户详细信息:

private lazy var view: UIView = {
        let view = UIView(frame: CGRectMake(0, 0, 34, 80))
        let label = UILabel()
        label.translatesAutoresizingMaskIntoConstraints = false
        let font = UIFont(name: "OpenSans-Semibold", size: 10.0)
        label.font = font
        return view
    }()

以下是您可以使用的示例PHP:

 https://graph.windows.net/myorganization/users/garthf%40a830edad9050849NDA1.onmicrosoft.com?api-version=1.6

有关完整的API文档和示例,请参阅以下链接:

https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/users-operations#getauser

答案 1 :(得分:2)

您可以使用Azure AD Graph API公开您发送HTTP请求的REST端点,以便执行操作。

要使用Graph API执行操作,您需要将HTTP请求发送到以服务为目标的端点,资源集合,单个资源,资源的导航属性或服务公开的功能或操作。端点表示为URL:

https://graph.windows.net/{tenant_id}/{resource_path}?{api_version}

以下组件包含网址:

  • 服务根:所有图谱API请求的服务根目录为https://graph.windows.net
  • 租户标识符{tenant_id}:请求所针对的租户的标识符。
  • 资源路径{resource_path}:请求所针对的资源路径(例如,用户或组)。
  • 图表API版本{api_version}:请求所针对的Graph API版本。这表示为查询参数,是必需的。

请参阅Azure AD Graph API operations overview

至于如何在PHP中处理HTTP请求,PHP buildin file_get_contents,经常使用第三方lib cURLPECL_HTTP

@Aram提供了PECL_HTTP的示例,您可以谷歌另外两个。

相关问题