How to revoke access to Microsoft APP for a user in php

夙愿已清 提交于 2020-02-04 04:10:25

问题


I've searched long and hard about how to revoke access to the Microsoft APP for a user account in PHP or any programming languages for that matter but couldn't find it...

There doesn't seem to be any msdn docs for achieving it... nor any API URL Endpoints in "login.microsoftonline.com".

Should we just remove the token in our web app database and just leave it?

but while accessing the account settings -> security and privacy -> connected apps the app is still there...

Plzzz someone share the url endpoint or the right method to do so

note: but google php client has the revoke method and they send the token to endpoint "https://accounts.google.com/o/oauth2/revoke"

is there any similar revoke endpoint for microsoft?


回答1:


If you are looking for the method to disable the user account in your tenant to access against to your AD applications.

You can set the accountEnabled property in the user account profile to false, which will lock the user account to prevent it authorize or authentic your applications.

You can leverage Microsoft Graph APIs to handle these operations. Refer to https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/user_update for the details of this API in Microsoft Graph.

And here is the sample in PHP at https://github.com/Azure-Samples/active-directory-php-graphapi-web, which presents how to use Microsoft Graph to handle users accounts in tenant.



来源:https://stackoverflow.com/questions/35717512/how-to-revoke-access-to-microsoft-app-for-a-user-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!