简体   繁体   English

可以在Azure AD上登录的Java代码,但无需登录portal.azure.com即可获得代码

[英]Java code to sign-in at Azure AD but need code without login to portal.azure.com

I have use below link to access all user of Azure AD but it require user to login in portal.azure.com 我使用下面的链接访问Azure AD的所有用户,但它要求用户登录portal.azure.com。

https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapp-java https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapp-java

I have also use below link to authenticate user but token return by it is not useful for access other API of Azure AD. 我还使用下面的链接对用户进行身份验证,但是通过它返回的令牌对于访问Azure AD的其他API没有用。 Using above url code it allow to access other API of Azure but require portal.azure.com login. 使用上述URL代码,它可以访问Azure的其他API,但需要portal.azure.com登录。

https://samlman.wordpress.com/2015/06/04/getting-an-azure-access-token-for-a-web-application-entirely-in-code/ https://samlman.wordpress.com/2015/06/04/getting-an-azure-access-token-for-a-web-application-entirely-in-code/

Need java code which doesnt require us to login in portal.azure.com for accessing it API 需要不需要我们登录portal.azure.com来访问它的API的Java代码

AFAIK, Azure AD implements four flows in the OAuth 2.0 authorization framework . AFAIK,Azure AD在OAuth 2.0授权框架中实现了四个流程。

And if you don't want to interact with Azure manually when acquiring the access token, you can choose the Resource Owner Password Credentials Grant or Client Credentials Grant flow based on your scenario. 并且,如果您不想在获取访问令牌时手动与Azure进行交互,则可以根据您的方案选择“ 资源所有者密码凭据授予”或“ 客户端凭据授予”流。

And normally, we need to sufficient permission to operate corresponding resource. 通常,我们需要足够的权限才能操作相应的资源。 Please share the exact resource/request you were developing and the detailed error message to help troubleshoot this issue if you still have the problem. 如果您仍然遇到问题,请共享确切的资源/请求以及详细的错误消息,以帮助解决此问题。

And this link is helpful to learn about the authentication scenarios for Azure AD. 而且此链接对于了解Azure AD的身份验证方案很有帮助。

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

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