本文整理汇总了Java中com.nimbusds.oauth2.sdk.Scope.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Scope.isEmpty方法的具体用法?Java Scope.isEmpty怎么用?Java Scope.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nimbusds.oauth2.sdk.Scope
的用法示例。
在下文中一共展示了Scope.isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doExecute
import com.nimbusds.oauth2.sdk.Scope; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
Scope registeredScopes = getMetadataContext().getClientInformation().getMetadata().getScope();
if (registeredScopes == null || registeredScopes.isEmpty()) {
log.debug("{} No registered scopes for client {}, nothing to do", getLogPrefix(),
getMetadataContext().getClientInformation().getID());
return;
}
Scope requestedScopes = scopeLookupStrategy.apply(profileRequestContext);
for (Iterator<Scope.Value> i = requestedScopes.iterator(); i.hasNext();) {
Scope.Value scope = i.next();
if (!registeredScopes.contains(scope)) {
log.warn("{} removing requested scope {} for rp {} as it is not a registered one", getLogPrefix(),
scope.getValue(), getMetadataContext().getClientInformation().getID());
i.remove();
}
}
getOidcResponseContext().setScope(requestedScopes);
}
示例2: doExecute
import com.nimbusds.oauth2.sdk.Scope; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
final Scope requestScope = getInputMetadata().getScope();
if (requestScope == null || requestScope.isEmpty()) {
log.debug("{} Scope in the request was null, adding default scope", getLogPrefix());
getOutputMetadata().setScope(defaultScope);
} else {
getOutputMetadata().setScope(requestScope);
}
}