當前位置: 首頁>>代碼示例>>Java>>正文


Java AttributeContext類代碼示例

本文整理匯總了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);
}
 
開發者ID:serac,項目名稱:shibboleth-idp-ext-cas,代碼行數:27,代碼來源:ExtractAttributesAction.java

示例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);

}
 
開發者ID:CSCfi,項目名稱:shibboleth-idp-oidc-extension,代碼行數:41,代碼來源:AddClaimsToIDTokenTest.java

示例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));
}
 
開發者ID:cmu-cylab-privacylens,項目名稱:PrivacyLens,代碼行數:9,代碼來源:AbstractAttributeReleaseAction.java

示例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));
}
 
開發者ID:CSCfi,項目名稱:shibboleth-idp-oidc-extension,代碼行數:6,代碼來源:AddClaimsToIDToken.java

示例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");
}
 
開發者ID:CSCfi,項目名稱:shibboleth-idp-oidc-extension,代碼行數:16,代碼來源:AddClaimsToIDToken.java

示例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");
}
 
開發者ID:cmu-cylab-privacylens,項目名稱:PrivacyLens,代碼行數:10,代碼來源:AbstractAttributeReleaseAction.java

示例7: getAttributeContext

import net.shibboleth.idp.attribute.context.AttributeContext; //導入依賴的package包/類
/**
 * Get the attribute context.
 * 
 * @return the attribute context
 */
@Nullable public AttributeContext getAttributeContext() {
    return attributeContext;
}
 
開發者ID:cmu-cylab-privacylens,項目名稱:PrivacyLens,代碼行數:9,代碼來源:AbstractAttributeReleaseAction.java


注:本文中的net.shibboleth.idp.attribute.context.AttributeContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。