本文整理汇总了Python中oic.oic.provider.Provider._scope2claims方法的典型用法代码示例。如果您正苦于以下问题:Python Provider._scope2claims方法的具体用法?Python Provider._scope2claims怎么用?Python Provider._scope2claims使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oic.oic.provider.Provider
的用法示例。
在下文中一共展示了Provider._scope2claims方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_user_info
# 需要导入模块: from oic.oic.provider import Provider [as 别名]
# 或者: from oic.oic.provider.Provider import _scope2claims [as 别名]
def _get_user_info(self, user_attributes, requested_claims=None, scopes=None):
"""
Filter user attributes to return to the client (as claims in the ID Token) based on what
was requested in request 'claims' parameter and in the 'scope'.
:type user_attributes: dict[str, str]
:type requested_claims: dict[str, Optional[dict]]
:type scopes: list[str]
:rtype: dict[str, str]
:param user_attributes: attributes provided by the backend
:param requested_claims: claims requested by the client through the 'claims' request param
:param scopes: the scopes requested by the client
:return: all attributes/claims to return to the client
"""
requested_claims = requested_claims or {}
scopes = scopes or []
claims_requested_by_scope = Provider._scope2claims(scopes)
claims_requested_by_scope.update(
requested_claims) # let explicit claims request override scope
return UserInfo().filter(user_attributes, claims_requested_by_scope)