除了Xamarin.Auth中的空字符串("")到Xamarin.Auth构造函数之外,还有哪些值可以传递给作用域?
有关OAuth2Authenticator使用https://components.xamarin.com/gettingstarted/xamarin.auth的更多信息,请参阅下面的链接
发布于 2016-12-26 15:28:38
这取决于您正在使用的身份验证提供程序。让我详细解释一下,比如说,
- [https://www.googleapis.com/auth/plus.login](https://www.googleapis.com/auth/plus.login)
- [https://www.googleapis.com/auth/plus.profile.emails.read](https://www.googleapis.com/auth/plus.profile.emails.read)
有关OAuth与Google的更多信息,请参考https://developers.google.com/+/web/api/rest/oauth
同样,对于其他供应商,请检查相应的网站文档。
希望这能有所帮助。
发布于 2016-12-26 15:36:32
Scopes通常用于定义您所请求的访问(权限)的类型。因此,如果授予访问令牌,则只分配这些范围给该令牌,如果需要将所需的范围/权限类型(例如从"read_only“范围更改为"readwrite”范围)更改为“readwrite”范围,则必须使用新范围请求新的令牌。
作用域是依赖于您要访问的服务的,并且将由该服务定义,它们是常用的作用域,如"read_only",但同样,服务定义了它们是什么。
也就是说,要同时请求用户的读写权限和离线访问用户的Microsoft OneDrive帐户的权限,您可以请求这个范围:
"onedrive.readwrite wl.offline_access"要访问Google日历,您可以通过作用域请求只访问视图(只读):
"https://www.googleapis.com/auth/calendar.readonly"要更改/管理用户日历,您需要:
"https://www.googleapis.com/auth/calendar"在一个请求多个作用域时,可能需要使用空格或逗号或其他定义的服务分隔符来分隔每个作用域。虽然空格分隔符非常常见,但这还是由您正在接口的服务定义的。
Ref:访问令牌范围/ https://www.rfc-editor.org/rfc/rfc6749#page-23
https://stackoverflow.com/questions/41332932
复制相似问题