英文:
Can username password flow be used to access inbox on exchange using EWS?
问题
我的目标是访问收件箱以下载电子邮件。我进行了一些研究,发现UsernamePasswordflow将符合我的要求。
但是不确定可以给予在Azure AD上创建的应用程序哪些权限。另外,如果我使用这个流程获取令牌,是否可以在Java EWS中使用该令牌?
英文:
My goal is to access the inbox to download emails.I did some research and found that UsernamePassowrdflow will fit in my requirement.
But not sure what permissions can be given to the application created on Azure AD.Also, If I acquire a token using this flow can this be used in java EWS?
答案1
得分: 0
当然,您可以使用UsernamePassowrdflow(ROPC流)。 但是权限与Auth code流相同。
请参考将应用程序权限范围限定为特定的Exchange Online邮箱,这可以将您的应用程序限制为仅访问指定的邮箱。
只需使用New-ApplicationAccessPolicy
PowerShell命令来配置访问控制。
New-ApplicationAccessPolicy -AppId e7e4dbfc-046f-4074-9b3b-2ae8f144f59b -PolicyScopeGroupId EvenUsers@contoso.com -AccessRight RestrictAccess -Description "将此应用限制为分发组EvenUsers的成员。"
英文:
Of course you could use UsernamePassowrdflow (ROPC flow). But the permissions are the same as Auth code flow.
Please refer to Scoping application permissions to specific Exchange Online mailboxes, which can limit your application to only access to the specified mailboxes.
Just use the New-ApplicationAccessPolicy
PowerShell cmdlet to configure access control.
New-ApplicationAccessPolicy -AppId e7e4dbfc-046f-4074-9b3b-2ae8f144f59b -PolicyScopeGroupId EvenUsers@contoso.com -AccessRight RestrictAccess -Description "Restrict this app to members of distribution group EvenUsers."
专注分享java语言的经验与见解,让所有开发者获益!
评论