x-minecraft-launcher
x-minecraft-launcher copied to clipboard
希望请求更少权限
To Reproduce 使用Microsoft账户登录启动器
Expected behavior 这个启动器请求了过多Microsoft账户和Xbox账户个人信息并且请求在不使用时随时可用,这有时是多余的(不排除是BUG造成),有的启动器甚至能直接显示登录Minecraft。 希望能优化一下,请求更少权限。这么多权限实在令我有些担心,特别是“不使用时也不例外的可以读取”等权限。
以下MultiMC的权限申请信息:
以下XMCL的权限申请信息:
关于 xbox 的权限我也觉得很奇怪为啥会和 mmc 不一样,我之前没注意过
mmc 的权限 scope 在这
MSAStep::MSAStep(AccountData* data, Action action) : AuthStep(data), m_action(action) {
OAuth2::Options opts;
opts.scope = "XboxLive.signin offline_access";
// rest of code...
}
https://github.com/MultiMC/Launcher/blob/0917706b22b21a3074b31c2e8b6a047f9fc560ca/launcher/minecraft/auth/steps/MSAStep.cpp#L15
xmcl 的是
export default class CredentialManager extends Manager {
readonly scopes: string[] = ['XboxLive.signin', 'XboxLive.offline_access']
readonly extraScopes: string[] = ['user.read']
}
https://github.com/Voxelum/x-minecraft-launcher/blob/master/xmcl-runtime/lib/managers/CredentialManager.ts#L9
我的理解是 'XboxLive.signin', 'XboxLive.offline_access'
和 "XboxLive.signin offline_access"
应该是等价的,其中 sigin 是基本登录,offline_access 是用于 refreshToken。回头可以试试改成上面那种work不work。
至于为什么需要 extraScopes user.read
,这里是因为 xmcl 有个进行中的 feature #231。
其中用户验证用的是 Microsoft 的 accessToken,从 server side 需要从 token 中读取 user 的 email 或 openid。
经过查找,确实发现 user.read 其中我并不需要 profile,因此我之后可以改成 ['user.email', 'user.openid', 'user.offline_access']
#350 Should remove all unused permissions