Examples of RahasData


Examples of org.apache.rahas.RahasData

    private static Log log = LogFactory.getLog(SampleAttributeService.class);

    public void handle(SAMLAttributeCallback attrCallback) throws SAMLException {
        log.info("SampleAttributeService being called");
        RahasData data = null;
        String userIdentifier = null;
        String password = null;

        try {
            data = attrCallback.getData();
            userIdentifier = data.getPrincipal().getName();
            password = getUserCredentials(MessageContext.getCurrentMessageContext().getEnvelope());
            log.info("User Identifier : " + userIdentifier);
            log.info("User Password : " + password);

            // Retrieving all attribute values set before.
View Full Code Here

Examples of org.apache.rahas.RahasData

    protected Map<String, RequestedClaimData> requestedClaims = new HashMap<String, RequestedClaimData>();
    protected Map<String, Claim> supportedClaims = new HashMap<String, Claim>();

    public void handle(SAMLCallback callback) throws SAMLException {
        SAMLAttributeCallback attrCallback = null;
        RahasData data = null;
        OMElement claimElem = null;
        String userIdentifier = null;
        IdentityAttributeService[] attributeCallbackServices = null;

        try {
            if (callback instanceof SAMLAttributeCallback) {
                attrCallback = (SAMLAttributeCallback) callback;
                data = attrCallback.getData();
                claimElem = data.getClaimElem();
                userIdentifier = data.getPrincipal().getName();
                loadClaims(userIdentifier);
                processClaimData(data, claimElem);
                populateClaimValues(userIdentifier, attrCallback);

                if (RahasConstants.TOK_TYPE_SAML_20.equals(data.getTokenType())) {
                    if (attrCallback.getSAML2Attributes() == null
                            || attrCallback.getSAML2Attributes().length == 0) {
                        attrCallback.addAttributes(getSAML2Attribute("Name", "Colombo",
                                "https://rahas.apache.org/saml/attrns"));
                    }
View Full Code Here

Examples of org.apache.rahas.RahasData

    }

    protected void populateClaimValues(String userIdentifier, SAMLAttributeCallback callback)
            throws IdentityProviderException {
        UserStoreManager connector = null;
        RahasData rahasData = null;

        if (log.isDebugEnabled()) {
            log.debug("Populating claim values");
        }

        if (requestedClaims.isEmpty()) {
            return;
        }

        try {
            connector = IdentityTenantUtil.getRealm(null, userIdentifier).getUserStoreManager();
        } catch (Exception e) {
            log.error("Error while instantiating IdentityUserStore", e);
            throw new IdentityProviderException("Error while instantiating IdentityUserStore", e);
        }

        // get the column names for the URIs
        Iterator<RequestedClaimData> ite = requestedClaims.values().iterator();
        List<String> claimList = new ArrayList<String>();
        rahasData = callback.getData();

        while (ite.hasNext()) {
            RequestedClaimData claim = (RequestedClaimData) ite.next();
            if (claim != null && !claim.getUri().equals(IdentityConstants.CLAIM_PPID)) {
                claimList.add(claim.getUri());
            }
        }

        String[] claimArray = new String[claimList.size()];
        String userId = userIdentifier;
        Map<String, String> mapValues = null;

        try {
            mapValues = connector.getUserClaimValues(userId, claimList.toArray(claimArray), null);
            ite = requestedClaims.values().iterator();
            while (ite.hasNext()) {
                SAMLAttribute attribute = null;
                Attribute saml2Attribute = null;
                RequestedClaimData claimData = ite.next();
                claimData.setValue(mapValues.get(claimData.getUri()));
                if (claimData.getValue() != null) {
                    if (RahasConstants.TOK_TYPE_SAML_20.equals(rahasData.getTokenType())) {
                        saml2Attribute = getSAML2Attribute(supportedClaims.get(claimData.getUri())
                                .getDisplayTag(), claimData.getValue(), claimData.getUri());
                        callback.addAttributes(saml2Attribute);
                    } else {
                        attribute = new SAMLAttribute(supportedClaims.get(claimData.getUri())
View Full Code Here

Examples of org.apache.rahas.RahasData

            MessageContext.getCurrentMessageContext().setProperty(WSHandlerConstants.RECV_RESULTS,
                    handlerResultsVector);
            MessageContext.getCurrentMessageContext().setProperty(RahasConstants.PASSIVE_STS_RST,
                    getRST(request.getRealm(), request.getAttributes()));

            rahasData = new RahasData(context);
            issuer = new SAMLPassiveTokenIssuer();
            issuer.setAudienceRestrictionCondition(request.getRealm());
            issuer.setConfig(getSAMLTokenIssuerConfig(MessageContext.getCurrentMessageContext()
                    .getAxisService()));
            rstr = issuer.issuePassiveRSTR(rahasData);
View Full Code Here

Examples of org.apache.rahas.RahasData

            MessageContext.getCurrentMessageContext().setProperty(WSHandlerConstants.RECV_RESULTS,
                    handlerResultsVector);
            MessageContext.getCurrentMessageContext().setProperty(RahasConstants.PASSIVE_STS_RST,
                    getRST(request.getRealm(), request.getAttributes()));

            rahasData = new RahasData(context);
            issuer = new SAMLPassiveTokenIssuer();
            issuer.setAudienceRestrictionCondition(request.getRealm());
            issuer.setConfig(getSAMLTokenIssuerConfig(MessageContext.getCurrentMessageContext()
                    .getAxisService()));
            rstr = issuer.issuePassiveRSTR(rahasData);
View Full Code Here

Examples of org.apache.rahas.RahasData

    private static Log log = LogFactory.getLog(StonehengeAttributeService.class);

    public void handle(SAMLAttributeCallback attrCallback) throws SAMLException {
        log.info("StonehengeAttributeService being called");
        RahasData data = null;
        String userIdentifier = null;
        String password = null;

        try {
            data = attrCallback.getData();

            // we're cheating and hardcoding the ppid value.
            // TODO: take it from the database
            if (RahasConstants.TOK_TYPE_SAML_20.equals(data.getTokenType())) {
                attrCallback.addAttributes(getSAML2Attribute("privatepersonalidentifier", "08C648FA-5C0E-4092-ABF8-E71785373CE8", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims"));
            } else {
            SAMLAttribute attribute = null;
            attribute = new SAMLAttribute("privatepersonalidentifier",
                    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims", null, -1, Arrays
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.