寻求有关该主题的指导,因为我真的坚持这一点,我有一个使用 PHP 制作的应用程序的内部 URL,我想连接到 Azure Active Directory.
到目前为止,我已经查看了
构建的 URL 将重定向到 sso 页面,登录后我们可以获得 code 值,用于下一步.
2、使用授权码请求访问令牌:
然后我们可以使用访问令牌在资源 Web API 的请求的 Authorization 标头中添加带有Bearer"标志的 JWT 字符串.
这是 Azure 提供的 PHP 测试项目您的参考.
Seeking for guidance on the subject as I'm really stuck on this, I have a internal URL for an App made on PHP and I want to connect to Azure Active Directory.
So far I've reviewed an example from Microsoft using SimpleSAML but it's really outdated and I'm having troubles adapting it for the newer SimpleSAMl code.
Is there a better way to integrate a web application with Azure AD? I read somewhere that I may use Get started with Mobile Services but I would like to hear from previous experiences on what is the best/current method for using Azure AD for login on PHP?.
-- EDIT --
By integrate I mean to allow people authenticate and retrieve the email address or EmployeeID from the Azure AD to provide SSO support.
解决方案There are several scenarios Azure AD supports, depend on what you use Azure AD for. Basically, to access the resources via Azure AD from PHP web application, you can refer to Web Application to Web API section to understand this scenario and get started.
To integrate Azure AD in PHP web applications, we need to follow authorization code grant flow steps to build several custom HTTP requests. E.G. To get access token via OAuth 2.0 protocol, we should refer to the steps on Authorization Code Grant Flow, generally, we will build 2 HTTP requests to get access token:
1,Request an authorization code
The build-up URL will redirect to the sso page, after login we can get the code value which will be used in next step.
2,Use the Authorization Code to Request an Access Token:
Then we can use the access token to add the JWT string with a "Bearer" designation in the Authorization header of the request to the resource web API.
Here is a PHP test project provided by Azure for your reference.
更多推荐
从 PHP Web 应用程序连接到 Azure Active Directory
发布评论