本文整理汇总了Java中net.shibboleth.idp.attribute.context.AttributeContext类的典型用法代码示例。如果您正苦于以下问题:Java AttributeContext类的具体用法?Java AttributeContext怎么用?Java AttributeContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttributeContext类属于net.shibboleth.idp.attribute.context包,在下文中一共展示了AttributeContext类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doExecute
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
@Nonnull
@Override
protected Event doExecute(
final @Nonnull RequestContext springRequestContext,
final @Nonnull ProfileRequestContext<TicketValidationRequest, TicketValidationResponse> profileRequestContext) {
final AttributeContext ac = attributeContextFunction.apply(profileRequestContext);
if (ac == null) {
log.info("AttributeContext not found in profile request context.");
return ProtocolError.IllegalState.event(this);
}
final TicketValidationResponse response = FlowStateSupport.getTicketValidationResponse(springRequestContext);
if (response == null) {
log.info("TicketValidationResponse not found in request scope.");
return ProtocolError.IllegalState.event(this);
}
for (IdPAttribute attribute : ac.getIdPAttributes().values()) {
log.debug("Processing {}", attribute);
for (IdPAttributeValue<?> value : attribute.getValues()) {
response.addAttribute(attribute.getId(), value.getValue().toString());
}
}
return Events.Proceed.event(this);
}
示例2: setAttributeContext
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private void setAttributeContext() {
// build 2 attributes
Collection<AttributeEncoder<?>> newEncoders = new ArrayList<AttributeEncoder<?>>();
OIDCStringAttributeEncoder encoder = new OIDCStringAttributeEncoder();
encoder.setName("test1");
newEncoders.add(encoder);
IdPAttribute attribute1 = new IdPAttribute("test1");
List<StringAttributeValue> stringAttributeValues1 = new ArrayList<StringAttributeValue>();
stringAttributeValues1.add(new StringAttributeValue("value1"));
stringAttributeValues1.add(new StringAttributeValue("value2"));
attribute1.setValues(stringAttributeValues1);
attribute1.setEncoders(newEncoders);
Collection<AttributeEncoder<?>> newEncoders2 = new ArrayList<AttributeEncoder<?>>();
OIDCStringAttributeEncoder encoder2 = new OIDCStringAttributeEncoder();
encoder2.setName("test2");
newEncoders2.add(encoder2);
IdPAttribute attribute2 = new IdPAttribute("test2");
List<StringAttributeValue> stringAttributeValues2 = new ArrayList<StringAttributeValue>();
stringAttributeValues2.add(new StringAttributeValue("value"));
attribute2.setValues(stringAttributeValues2);
attribute2.setEncoders(newEncoders2);
IdPAttribute attribute3 = new IdPAttribute("test3");
List<StringAttributeValue> stringAttributeValues3 = new ArrayList<StringAttributeValue>();
stringAttributeValues3.add(new StringAttributeValue("value3"));
attribute3.setValues(stringAttributeValues3);
final ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(requestCtx);
AttributeContext attributeCtx = new AttributeContext();
Collection<IdPAttribute> attributes = new ArrayList<IdPAttribute>();
attributes.add(attribute1);
attributes.add(attribute2);
attributes.add(attribute3);
attributeCtx.setIdPAttributes(attributes);
prc.getSubcontext(RelyingPartyContext.class).addSubcontext(attributeCtx);
}
示例3: AbstractAttributeReleaseAction
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
/** Constructor. */
public AbstractAttributeReleaseAction() {
attributeReleaseContextLookupStrategy = new ChildContextLookup<>(AttributeReleaseContext.class, false);
attributeContextLookupStrategy =
Functions.compose(new ChildContextLookup<>(AttributeContext.class),
new ChildContextLookup<ProfileRequestContext, RelyingPartyContext>(RelyingPartyContext.class));
}
示例4: AddClaimsToIDToken
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
/** Constructor. */
AddClaimsToIDToken() {
attributeContextLookupStrategy = Functions.compose(new ChildContextLookup<>(AttributeContext.class),
new ChildContextLookup<ProfileRequestContext, RelyingPartyContext>(RelyingPartyContext.class));
}
示例5: setAttributeContextLookupStrategy
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
/**
* Set the strategy used to locate the {@link AttributeContext} associated
* with a given {@link ProfileRequestContext}.
*
* @param strategy
* strategy used to locate the {@link AttributeContext}
* associated with a given {@link ProfileRequestContext}
*/
public void setAttributeContextLookupStrategy(
@Nonnull final Function<ProfileRequestContext, AttributeContext> strategy) {
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
attributeContextLookupStrategy = Constraint.isNotNull(strategy,
"AttributeContext lookup strategy cannot be null");
}
示例6: setAttributeContextLookupStrategy
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
/**
* Set the attribute context lookup strategy.
*
* @param strategy the attribute context lookup strategy
*/
public void setAttributeContextLookupStrategy(Function<ProfileRequestContext, AttributeContext> strategy) {
attributeContextLookupStrategy =
Constraint.isNotNull(strategy, "Attribute context lookup strategy cannot be null");
}
示例7: getAttributeContext
import net.shibboleth.idp.attribute.context.AttributeContext; //导入依赖的package包/类
/**
* Get the attribute context.
*
* @return the attribute context
*/
@Nullable public AttributeContext getAttributeContext() {
return attributeContext;
}