// Path: idp-oidc-impl/src/main/java/net/shibboleth/idp/oidc/OIDCException.java
// public class OIDCException extends InvalidRequestException {
// 
// 
//     /**
//      * Instantiates a new Oidc exception.
//      */
//     public OIDCException() {
//         super("Invalid request");
//     }
//     
//     /**
//      * Instantiates a new Oidc exception.
//      *
//      * @param message the message
//      */
//     public OIDCException(final String message) {
//         super(message);
//     }
// 
//     /**
//      * Instantiates a new Oidc exception.
//      *
//      * @param message the message
//      * @param cause   the cause
//      */
//     public OIDCException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * Instantiates a new Oidc exception.
//      *
//      * @param cause   the cause
//      */
//     public OIDCException(final Throwable cause) {
//         this(cause.getMessage(), cause);
//     }
// }


import com.google.common.base.Strings;
import net.shibboleth.idp.attribute.EmptyAttributeValue;
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.filter.AttributeFilter;
import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
import net.shibboleth.idp.attribute.resolver.AttributeResolver;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
import net.shibboleth.idp.oidc.OIDCException;
import net.shibboleth.utilities.java.support.service.ReloadableService;
import org.mitre.openid.connect.model.DefaultAddress;
import org.mitre.openid.connect.model.DefaultUserInfo;
import org.mitre.openid.connect.model.UserInfo;
import org.mitre.openid.connect.repository.UserInfoRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;
import java.util.Map;
            resolver.resolveAttributes(attributeContext);
            final Map<String, IdPAttribute> resolvedAttributes = attributeContext.getResolvedIdPAttributes();

            final AttributeFilterContext filterContext = new AttributeFilterContext();
            filterContext.setPrincipal(username);
            filterContext.setAttributeIssuerID(getClass().getSimpleName());
            filterContext.setPrefilteredIdPAttributes(resolvedAttributes.values());
            filterContext.setAttributeRecipientID(recipientId);
            filter.filterAttributes(filterContext);

            final Map<String, IdPAttribute> filteredAttributes = filterContext.getFilteredIdPAttributes();
            for (final String attributeKey : filteredAttributes.keySet()) {
                final IdPAttribute attribute = filteredAttributes.get(attributeKey);
                log.debug("Attribute {} is authorized for release. Mapping...", attribute.getId());
                setUserInfoClaimByAttribute(username, userInfo, attribute);
            }
        } catch (final Exception e) {
            log.error(e.getMessage(), e);
        }

        if (Strings.isNullOrEmpty(userInfo.getSub())) {
            log.warn("userinfo sub claim cannot be null/empty. Reset claim value to {}", username);
            userInfo.setSub(username);
        }
        log.debug("Final userinfo object constructed from attributes is\n {}", userInfo.toJson());
        return userInfo;
    }

    @Override
    public UserInfo getByEmailAddress(final String s) {
// Path: idp-oidc-impl/src/main/java/net/shibboleth/idp/oidc/OIDCException.java
// public class OIDCException extends InvalidRequestException {
// 
// 
//     /**
//      * Instantiates a new Oidc exception.
//      */
//     public OIDCException() {
//         super("Invalid request");
//     }
//     
//     /**
//      * Instantiates a new Oidc exception.
//      *
//      * @param message the message
//      */
//     public OIDCException(final String message) {
//         super(message);
//     }
// 
//     /**
//      * Instantiates a new Oidc exception.
//      *
//      * @param message the message
//      * @param cause   the cause
//      */
//     public OIDCException(final String message, final Throwable cause) {
//         super(message, cause);
//     }
// 
//     /**
//      * Instantiates a new Oidc exception.
//      *
//      * @param cause   the cause
//      */
//     public OIDCException(final Throwable cause) {
//         this(cause.getMessage(), cause);
//     }
// }


// Path: idp-oidc-impl/src/main/java/net/shibboleth/idp/oidc/client/userinfo/ShibbolethUserInfoRepository.java
import com.google.common.base.Strings;
import net.shibboleth.idp.attribute.EmptyAttributeValue;
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.filter.AttributeFilter;
import net.shibboleth.idp.attribute.filter.context.AttributeFilterContext;
import net.shibboleth.idp.attribute.resolver.AttributeResolver;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
import net.shibboleth.idp.oidc.OIDCException;
import net.shibboleth.utilities.java.support.service.ReloadableService;
import org.mitre.openid.connect.model.DefaultAddress;
import org.mitre.openid.connect.model.DefaultUserInfo;
import org.mitre.openid.connect.model.UserInfo;
import org.mitre.openid.connect.repository.UserInfoRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;
import java.util.Map;

            resolver.resolveAttributes(attributeContext);
            final Map<String, IdPAttribute> resolvedAttributes = attributeContext.getResolvedIdPAttributes();

            final AttributeFilterContext filterContext = new AttributeFilterContext();
            filterContext.setPrincipal(username);
            filterContext.setAttributeIssuerID(getClass().getSimpleName());
            filterContext.setPrefilteredIdPAttributes(resolvedAttributes.values());
            filterContext.setAttributeRecipientID(recipientId);
            filter.filterAttributes(filterContext);

            final Map<String, IdPAttribute> filteredAttributes = filterContext.getFilteredIdPAttributes();
            for (final String attributeKey : filteredAttributes.keySet()) {
                final IdPAttribute attribute = filteredAttributes.get(attributeKey);
                log.debug("Attribute {} is authorized for release. Mapping...", attribute.getId());
                setUserInfoClaimByAttribute(username, userInfo, attribute);
            }
        } catch (final Exception e) {
            log.error(e.getMessage(), e);
        }

        if (Strings.isNullOrEmpty(userInfo.getSub())) {
            log.warn("userinfo sub claim cannot be null/empty. Reset claim value to {}", username);
            userInfo.setSub(username);
        }
        log.debug("Final userinfo object constructed from attributes is\n {}", userInfo.toJson());
        return userInfo;
    }

    @Override
    public UserInfo getByEmailAddress(final String s) {
        throw new OIDCException("Operation is not supported");