• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ResolverException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.shibboleth.utilities.java.support.resolver.ResolverException的典型用法代码示例。如果您正苦于以下问题:Java ResolverException类的具体用法?Java ResolverException怎么用?Java ResolverException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ResolverException类属于net.shibboleth.utilities.java.support.resolver包,在下文中一共展示了ResolverException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doInvoke

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doInvoke(@Nonnull final MessageContext messageContext) throws MessageHandlerException {
    ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
    // Resolve client id from inbound message
    final ClientID clientId = RequestFieldResolver.getClientID((AbstractRequest) messageContext.getMessage());
    // Resolve metadata for client id
    final ClientIDCriterion clientCriterion = new ClientIDCriterion(clientId);
    final CriteriaSet criteria = new CriteriaSet(clientCriterion);
    try {
        final OIDCClientInformation clientInformation = clientResolver.resolveSingle(criteria);
        if (clientInformation == null) {
            log.warn("{} No client information returned for {}", getLogPrefix(), clientId);
            return;
        }
        final OIDCMetadataContext oidcCtx = new OIDCMetadataContext();
        oidcCtx.setClientInformation(clientInformation);
        messageContext.addSubcontext(oidcCtx);
        // Based on that info we know 1) client is valid 2) we know valid
        // redirect uris
        log.debug("{} {} added to MessageContext as child of {}", getLogPrefix(),
                OIDCMetadataContext.class.getName(), messageContext.getClass().getName());
    } catch (ResolverException e) {
        log.error("{} ResolverException thrown during client information lookup", getLogPrefix(), e);
    }
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:27,代码来源:OIDCMetadataLookupHandler.java


示例2: inputstreamToByteArray

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/**
 * Converts an InputStream into a byte array.
 * 
 * @param ins input stream to convert
 * 
 * @return resultant byte array
 * 
 * @throws ResolverException thrown if there is a problem reading the resultant byte array
 */
public static byte[] inputstreamToByteArray(InputStream ins) throws ResolverException {
    try {
        // 1 MB read buffer
        byte[] buffer = new byte[1024 * 1024];
        ByteArrayOutputStream output = new ByteArrayOutputStream();

        int n = 0;
        while (-1 != (n = ins.read(buffer))) {
            output.write(buffer, 0, n);
        }

        ins.close();
        return output.toByteArray();
    } catch (IOException e) {
        throw new ResolverException(e);
    }
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:27,代码来源:ResolverHelper.java


示例3: resolve

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override @Nonnull public Iterable<OIDCClientInformation> resolve(final CriteriaSet criteria) 
        throws ResolverException {

    ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
    ServiceableComponent<ClientInformationResolver> component = null;
    try {
        component = service.getServiceableComponent();
        if (null == component) {
            log.error("RelyingPartyClientInformationProvider '{}': Error accessing underlying source: "
                    + "Invalid configuration.", getId());
        } else {
            final ClientInformationResolver resolver = component.getComponent();
            return resolver.resolve(criteria);
        }
    } catch (final ResolverException e) {
        log.error("RelyingPartyClientInformationProvider '{}': Error during resolution", getId(), e);
    } finally {
        if (null != component) {
            component.unpinComponent();
        }
    }
    return Collections.EMPTY_SET;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:25,代码来源:ReloadingRelyingPartyClientInformationProvider.java


示例4: resolveSingle

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override @Nullable public OIDCClientInformation resolveSingle(final CriteriaSet criteria) 
        throws ResolverException {

    ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
    ServiceableComponent<ClientInformationResolver> component = null;
    try {
        component = service.getServiceableComponent();
        if (null == component) {
            log.error("RelyingPartyClientInformationProvider '{}': Error accessing underlying source: "
                    + "Invalid configuration.", getId());
        } else {
            final ClientInformationResolver resolver = component.getComponent();
            return resolver.resolveSingle(criteria);
        }
    } catch (final ResolverException e) {
        log.error("RelyingPartyResolver '{}': Error during resolution", getId(), e);
    } finally {
        if (null != component) {
            component.unpinComponent();
        }
    }
    return null;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:25,代码来源:ReloadingRelyingPartyClientInformationProvider.java


示例5: parse

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected OIDCProviderMetadata parse(byte[] bytes) throws ParseException {
    final OIDCProviderMetadata result = OIDCProviderMetadata.parse(JSONObjectUtils.parse(new String(bytes)));
    final JSONObject jsonResult = result.toJSONObject();
    for (final String key : dynamicResolvers.keySet()) {
        log.debug("Starting to resolve value for {}", key);
        final RefreshableMetadataValueResolver resolver = dynamicResolvers.get(key);
        try {
            resolver.refresh();
            final Object value = resolver.resolveSingle(null);
            if (value != null) {
                jsonResult.put(key, value);
                log.debug("The field {} updated to the result", key);
            }
        } catch (ResolverException e) {
            log.warn("Could not resolve a value for {̛}, ignoring it.", key, e);
        }
    }
    return OIDCProviderMetadata.parse(jsonResult);
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:DynamicFilesystemProviderMetadataResolver.java


示例6: lookupIdentifier

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/**
 * Get list of information matching a given identifier.
 * 
 * @param identifier identifier to lookup
 * @return a list of information
 * @throws ResolverException if an error occurs
 */
@Nonnull @NonnullElements protected List<Value> lookupIdentifier(
        @Nonnull @NotEmpty final Key identifier)
        throws ResolverException {
    if (!isInitialized()) {
        throw new ResolverException("Metadata resolver has not been initialized");
    }

    if (identifier == null || Strings.isNullOrEmpty(identifier.getValue())) {
        log.debug("Identifier was null or empty, skipping search for it");
        return Collections.emptyList();
    }

    List<Value> allInformation = lookupIndexedIdentifier(identifier);
    if (allInformation.isEmpty()) {
        log.debug("Backing store does not contain any information with the ID: {}", identifier);
        return allInformation;
    }
    return allInformation;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:27,代码来源:AbstractOIDCEntityResolver.java


示例7: resolve

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@Nonnull public Iterable<OIDCClientInformation> resolve(@Nullable final CriteriaSet criteria) 
        throws ResolverException {
    ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);

    for (final ClientInformationResolver resolver : resolvers) {
        try {
            final Iterable<OIDCClientInformation> clientInformations = resolver.resolve(criteria);
            if (clientInformations != null && clientInformations.iterator().hasNext()) {
                return clientInformations;
            }
        } catch (final ResolverException e) {
            log.warn("Error retrieving client information from resolver of type {}, proceeding to next resolver",
                    resolver.getClass().getName(), e);
            continue;
        }
    }

    return Collections.emptyList();
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:ChainingClientInformationResolver.java


示例8: fetchMetadata

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected byte[] fetchMetadata() throws ResolverException {
    try {
        ResolverHelper.validateMetadataFile(metadataFile);
        DateTime metadataUpdateTime = getMetadataUpdateTime();
        if (getLastRefresh() == null || getLastUpdate() == null || metadataUpdateTime.isAfter(getLastRefresh())) {
            log.debug("Returning the contents of {} as byte array", metadataFile.toPath());
            return ResolverHelper.inputstreamToByteArray(new FileInputStream(metadataFile));
        }
        return null;
    } catch (IOException e) {
        String errMsg = "Unable to read metadata file " + metadataFile.getAbsolutePath();
        log.error(errMsg, e);
        throw new ResolverException(errMsg, e);
    }
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:18,代码来源:AbstractFileOIDCEntityResolver.java


示例9: getSingleSignOn

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
public URI getSingleSignOn(String entityId) {
    EntityDescriptor idpEntityDescriptor;
    try {
        CriteriaSet criteria = new CriteriaSet(new EntityIdCriterion(entityId));
        idpEntityDescriptor = metadataProvider.resolveSingle(criteria);
    } catch (ResolverException e) {
        LOG.error(format("Exception when accessing metadata: {0}", e));
        throw propagate(e);
    }

    if(idpEntityDescriptor!=null) {
        final IDPSSODescriptor idpssoDescriptor = idpEntityDescriptor.getIDPSSODescriptor(SAMLConstants.SAML20P_NS);
        final List<SingleSignOnService> singleSignOnServices = idpssoDescriptor.getSingleSignOnServices();
        if (singleSignOnServices.isEmpty()) {
            LOG.error(format("No singleSignOnServices present for IDP entityId: {0}", entityId));
        } else {
            if (singleSignOnServices.size() > 1) {
                LOG.warn(format("More than one singleSignOnService present: {0} for {1}", singleSignOnServices.size(), entityId));
            }
            return URI.create(singleSignOnServices.get(0).getLocation());
        }
    }

    throw ApplicationException.createUnauditedException(ExceptionType.NOT_FOUND, UUID.randomUUID(), new RuntimeException(format("no entity descriptor for IDP: {0}", entityId)));

}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:27,代码来源:IdpSingleSignOnServiceHelper.java


示例10: validateAll

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
public void validateAll() {
    try {
        Iterable<EntityDescriptor> entityDescriptors = metadataResolver.resolve(new CriteriaSet(new EntityIdCriterion(hubFederationId)));
        entityDescriptors.forEach(entityDescriptor -> {
            String entityID = entityDescriptor.getEntityID();
            if (hubEntityId.equals(entityDescriptor.getEntityID())) {
                metadataCertificatesRepository.getHubEncryptionCertificates(entityID);
                metadataCertificatesRepository.getHubSigningCertificates(entityID);
            } else {
                metadataCertificatesRepository.getIdpSigningCertificates(entityID);
            }
        });
    } catch (ResolverException e) {
        throw new InvalidSamlMetadataException("Metadata could not be read from the metadata service", e);
    }
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:17,代码来源:MetadataCertificateValidator.java


示例11: getMatchingServiceAdapterMetadata

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
public Document getMatchingServiceAdapterMetadata() throws ResolverException, FederationMetadataLoadingException {
    EntitiesDescriptor entitiesDescriptor = new EntitiesDescriptorBuilder().buildObject();
    entitiesDescriptor.setValidUntil(DateTime.now().plusHours(1));

    final EntityDescriptor msaEntityDescriptor = createEntityDescriptor(msaConfiguration.getEntityId());
    final OpenSamlXmlObjectFactory openSamlXmlObjectFactory = new OpenSamlXmlObjectFactory();
    msaEntityDescriptor.getRoleDescriptors().add(getAttributeAuthorityDescriptor(openSamlXmlObjectFactory));
    msaEntityDescriptor.getRoleDescriptors().add(getIdpSsoDescriptor(openSamlXmlObjectFactory));

    entitiesDescriptor.getEntityDescriptors().add(msaEntityDescriptor);

    if (matchingServiceAdapterConfiguration.shouldRepublishHubCertificates()) {
        entitiesDescriptor.getEntityDescriptors().add(getHubEntityDescriptor());
    }

    return entitiesDescriptorElementTransformer.apply(entitiesDescriptor).getOwnerDocument();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:18,代码来源:MatchingServiceAdapterMetadataRepository.java


示例12: shouldHaveAnIDPSSODescriptor

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldHaveAnIDPSSODescriptor() throws ResolverException, FederationMetadataLoadingException {
    when(certificateStore.getSigningCertificates()).thenReturn(asList(getCertificate()));

    Document matchingServiceAdapterMetadata = matchingServiceAdapterMetadataRepository.getMatchingServiceAdapterMetadata();
    EntityDescriptor msa = getEntityDescriptor(matchingServiceAdapterMetadata, entityId);

    assertThat(msa.getRoleDescriptors().size()).isEqualTo(2);
    IDPSSODescriptor idpssoDescriptor = msa.getIDPSSODescriptor(SAMLConstants.SAML20P_NS);
    assertThat(idpssoDescriptor).isNotNull();
    assertThat(idpssoDescriptor.getSingleSignOnServices()).hasSize(1);
    assertThat(idpssoDescriptor.getSingleSignOnServices().get(0).getLocation()).isEqualTo(hubSsoEndPoint);

    // Shibboleth SP doesn't like the xsi:type="md:EndpointType" attribute on the SingleSignOnService element:
    assertThat(idpssoDescriptor.getSingleSignOnServices().get(0).getSchemaType()).isNull();

    assertThat(idpssoDescriptor.getKeyDescriptors()).hasSize(1);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:19,代码来源:MatchingServiceAdapterMetadataRepositoryTest.java


示例13: shouldValidateAttributeQuerySuccessfully

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldValidateAttributeQuerySuccessfully() throws ResolverException {
    final EncryptedAssertion encryptedAssertion = anAssertion().addAuthnStatement(anAuthnStatement().build()).withConditions(aConditions()).build();
    final String requestId = "request-id";
    final AttributeQuery attributeQuery = anAttributeQuery()
        .withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
        .withSignature(
            aSignature()
                .withSigningCredential(
                    new TestCredentialFactory(
                        HUB_TEST_PUBLIC_SIGNING_CERT,
                        HUB_TEST_PRIVATE_SIGNING_KEY
                    ).getSigningCredential()
                ).build()
        )
        .withId(requestId)
        .withSubject(aSubjectWithEncryptedAssertion(encryptedAssertion, requestId, HUB_ENTITY_ID))
        .build();
    when(assertionDecrypter.decryptAssertions(any())).thenReturn(Arrays.asList(anEidasAssertion().withConditions(aConditions()).buildUnencrypted()));

    Messages messages = validator.validate(attributeQuery, messages());

    assertThat(messages.size()).isEqualTo(0);
    assertThat(messages.hasErrors()).isFalse();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:26,代码来源:EidasAttributeQueryValidatorTest.java


示例14: shouldReturnErrorWhenAttributeQueryIssuerValidationFails

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldReturnErrorWhenAttributeQueryIssuerValidationFails() throws ResolverException {
    final EncryptedAssertion encryptedAssertion = anAssertion().build();
    final Assertion assertion = anAssertion().addAuthnStatement(anAuthnStatement().build()).buildUnencrypted();
    final String requestId = "request-id";
    final AttributeQuery attributeQuery = anAttributeQuery()
        .withIssuer(anIssuer().withIssuerId("").build())
        .withSignature(
            aSignature()
                .withSigningCredential(
                    new TestCredentialFactory(
                        HUB_TEST_PUBLIC_SIGNING_CERT,
                        HUB_TEST_PRIVATE_SIGNING_KEY
                    ).getSigningCredential()
                ).build()
        )
        .withId(requestId)
        .withSubject(aSubjectWithEncryptedAssertion(encryptedAssertion, requestId, HUB_ENTITY_ID))
        .build();
    when(assertionDecrypter.decryptAssertions(any())).thenReturn(Arrays.asList(assertion));

    Messages messages = validator.validate(attributeQuery, messages());

    assertThat(messages.hasErrorLike(DEFAULT_ISSUER_EMPTY_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:26,代码来源:EidasAttributeQueryValidatorTest.java


示例15: shouldReturnErrorWhenAttributeQuerySignatureValidationFails

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldReturnErrorWhenAttributeQuerySignatureValidationFails() throws ResolverException {
    final EncryptedAssertion encryptedAssertion = anAssertion().withConditions(aConditions()).build();
    final String requestId = "request-id";
    final AttributeQuery attributeQuery = anAttributeQuery()
        .withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
        .withSignature(
            aSignature()
                .withSigningCredential(
                    new TestCredentialFactory(
                        TEST_RP_PUBLIC_SIGNING_CERT,
                        TEST_RP_PRIVATE_SIGNING_KEY
                    ).getSigningCredential()
                ).build()
        )
        .withId(requestId)
        .withSubject(aSubjectWithEncryptedAssertion(encryptedAssertion, requestId, HUB_ENTITY_ID))
        .build();
    when(assertionDecrypter.decryptAssertions(any())).thenReturn(Arrays.asList(anEidasAssertion().withConditions(aConditions()).buildUnencrypted()));

    Messages messages = validator.validate(attributeQuery, messages());

    assertThat(messages.hasErrorLike(DEFAULT_INVALID_SIGNATURE_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:25,代码来源:EidasAttributeQueryValidatorTest.java


示例16: shouldReturnErrorWhenAnEncryptedAssertionValidationFails

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldReturnErrorWhenAnEncryptedAssertionValidationFails() throws ResolverException {
    final EncryptedAssertion encryptedAssertion = anAssertion().withIssuer(anIssuer().withIssuerId("").build()).build();
    final Assertion assertion = anAssertion().addAuthnStatement(anAuthnStatement().build()).withIssuer(anIssuer().withIssuerId("").build()).buildUnencrypted();
    final String requestId = "request-id";
    final AttributeQuery attributeQuery = anAttributeQuery()
        .withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
        .withSignature(
            aSignature()
                .withSigningCredential(
                    new TestCredentialFactory(
                        HUB_TEST_PUBLIC_SIGNING_CERT,
                        HUB_TEST_PRIVATE_SIGNING_KEY
                    ).getSigningCredential()
                ).build()
        )
        .withId(requestId)
        .withSubject(aSubjectWithEncryptedAssertion(encryptedAssertion, requestId, HUB_ENTITY_ID))
        .build();
    when(assertionDecrypter.decryptAssertions(any())).thenReturn(Arrays.asList(assertion));


    Messages messages = validator.validate(attributeQuery, messages());

    assertThat(messages.hasErrorLike(generateEmptyIssuerMessage(IDENTITY_ASSERTION))).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:27,代码来源:EidasAttributeQueryValidatorTest.java


示例17: shouldReturnErrorWhenAnEncryptedAssertionIsMissing

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldReturnErrorWhenAnEncryptedAssertionIsMissing() throws ResolverException {
    final AttributeQuery attributeQuery = anAttributeQuery()
        .withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
        .withSignature(
            aSignature()
                .withSigningCredential(
                    new TestCredentialFactory(
                        HUB_TEST_PUBLIC_SIGNING_CERT,
                        HUB_TEST_PRIVATE_SIGNING_KEY
                    ).getSigningCredential()
                ).build()
        )
        .withSubject(null)
        .build();

    Messages messages = validator.validate(attributeQuery, messages());

    assertThat(messages.size()).isEqualTo(1);
    assertThat(messages.hasErrorLike(EidasAttributeQueryValidator.DEFAULT_ENCRYPTED_ASSERTIONS_MISSING_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:22,代码来源:EidasAttributeQueryValidatorTest.java


示例18: shouldReturnErrorWhenAttributeQueryContainsAnEmptySubjectConfirmation

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
@Test
public void shouldReturnErrorWhenAttributeQueryContainsAnEmptySubjectConfirmation() throws ResolverException {
    final AttributeQuery attributeQuery = anAttributeQuery()
        .withIssuer(anIssuer().withIssuerId(HUB_ENTITY_ID).build())
        .withSignature(
            aSignature()
                .withSigningCredential(
                    new TestCredentialFactory(
                        HUB_TEST_PUBLIC_SIGNING_CERT,
                        HUB_TEST_PRIVATE_SIGNING_KEY
                    ).getSigningCredential()
                ).build()
        )
        .withSubject(aSubject().withSubjectConfirmation(null).build())
        .build();

    Messages messages = validator.validate(attributeQuery, messages());

    assertThat(messages.size()).isEqualTo(1);
    assertThat(messages.hasErrorLike(EidasAttributeQueryValidator.DEFAULT_ENCRYPTED_ASSERTIONS_MISSING_MESSAGE)).isTrue();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:22,代码来源:EidasAttributeQueryValidatorTest.java


示例19: resolve

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Iterable<OIDCClientInformation> resolve(CriteriaSet criteria) throws ResolverException {
    ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
    ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);

    final ClientIDCriterion clientIdCriterion = criteria.get(ClientIDCriterion.class);
    if (clientIdCriterion == null || clientIdCriterion.getClientID() == null) {
        log.warn("No client ID criteria found, returning empty set.");
        return Collections.emptyList();
    }
    //TODO: support other criterion
    final String clientId = clientIdCriterion.getClientID().getValue();
    final List<OIDCClientInformation> result = new ArrayList<>();
    try {
        final StorageRecord record = getStorageService().read(CONTEXT_NAME, clientId);
        if (record == null) {
            log.error("Could not find any records with clientId {}", clientId);
        } else {
            final OIDCClientInformation clientInformation = 
                    OIDCClientInformation.parse(JSONObjectUtils.parse(record.getValue()));
            log.debug("Found a record with clientId {}", clientId);
            result.add(clientInformation);
        }
    } catch (IOException | ParseException e) {
        log.error("Could not read the storage data", e);
    }
    return result;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:30,代码来源:StorageServiceClientInformationResolver.java


示例20: resolveSingle

import net.shibboleth.utilities.java.support.resolver.ResolverException; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public OIDCClientInformation resolveSingle(CriteriaSet criteria) throws ResolverException {
    final Iterable<OIDCClientInformation> iterable = resolve(criteria);
    if (iterable != null) {
        final Iterator<OIDCClientInformation> iterator = iterable.iterator();
        if (iterator != null && iterator.hasNext()) {
            return iterator.next();
        }
    }
    log.warn("Could not find any clients with the given criteria");
    return null;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:14,代码来源:StorageServiceClientInformationResolver.java



注:本文中的net.shibboleth.utilities.java.support.resolver.ResolverException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Type类代码示例发布时间:2022-05-22
下一篇:
Java ContainerRegistry类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap