Examples of IDPConfig


Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

    @GET
    @Path("/{realm}/")
    public IDPConfig getIDP(@PathParam("realm") String realm) {
        LOG.info("get IDP config for realm: " + realm);

        IDPConfig currentConfig = configService.getIDPConfig(realm);
        if (currentConfig == null) {
            throw new NotFoundException();
        }
        return currentConfig;
    }
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

    @PUT
    @Path("/")
    public Response updateIDP(IDPConfig idp) {
        LOG.info("update IDP config for realm: " + idp.getRealm());

        IDPConfig currentConfig = getIDP(idp.getRealm());

        Response r;
        if (!currentConfig.equals(idp)) {
            configService.setIDPConfig(idp);
            r = Response.ok().build();
        } else {
            r = Response.notModified().build();
        }
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

    @DELETE
    @Path("/{realm}/")
    public Response deleteIDP(@PathParam("realm") String realm) {
        LOG.info("delete IDP config for realm: " + realm);

        IDPConfig config = configService.removeIDPConfig(realm);

        Response r;
        if (config != null) {
            r = Response.ok().build();
        } else {
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

       
        String wtrealm = (String)WebUtils.getAttributeFromFlowScope(context, FederationConstants.PARAM_TREALM);

        SecurityToken idpToken = getSecurityToken(context);

        IDPConfig idpConfig = (IDPConfig) WebUtils.getAttributeFromFlowScope(context, IDP_CONFIG);

        Bus cxfBus = getBus();

        IdpSTSClient sts = new IdpSTSClient(cxfBus);
        sts.setAddressingNamespace(HTTP_WWW_W3_ORG_2005_08_ADDRESSING);
       
        ServiceConfig serviceConfig = idpConfig.getServices().get(wtrealm);
        if (serviceConfig == null) {
            LOG.warn("No service config found for " + wtrealm);
            throw new ProcessingException(TYPE.BAD_REQUEST);
        }
       
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

        IOException {
        response.setContentType("text/xml");
        PrintWriter out = response.getWriter();
        try {
            ConfigService cs = (ConfigService)getApplicationContext().getBean("config");
            IDPConfig idpConfig = cs.getIDPConfig(realm);
            LOG.debug(idpConfig.toString());
            MetadataWriter mw = new MetadataWriter();
            Document metadata =  mw.getMetaData(idpConfig);
            out.write(DOM2Writer.nodeToString(metadata));
        } catch (Exception ex) {
            LOG.error("Failed to get metadata document: ", ex);
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

   
    @Test
    public void testWriteIDPMetadata() {
        ConfigService config = (ConfigService)applicationContext.getBean("config");
        Assert.notNull(config, "ConfigService must not be null");
        IDPConfig idpConfig = config.getIDPConfig("urn:org:apache:cxf:fediz:idp:realm-A");
        Assert.notNull(idpConfig, "IDPConfig must not be null");
       
        MetadataWriter writer = new MetadataWriter();
        Document doc = writer.getMetaData(idpConfig);
        Assert.notNull(doc, "doc must not be null");
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

       
        String wtrealm = (String)WebUtils.getAttributeFromFlowScope(context, FederationConstants.PARAM_TREALM);

        SecurityToken idpToken = getSecurityToken(context);

        IDPConfig idpConfig = (IDPConfig) WebUtils.getAttributeFromFlowScope(context, IDP_CONFIG);

        Bus cxfBus = getBus();

        IdpSTSClient sts = new IdpSTSClient(cxfBus);
        sts.setAddressingNamespace(HTTP_WWW_W3_ORG_2005_08_ADDRESSING);
       
        ServiceConfig serviceConfig = idpConfig.getServices().get(wtrealm);
        if (serviceConfig == null) {
            LOG.warn("No service config found for " + wtrealm);
            throw new ProcessingException(TYPE.BAD_REQUEST);
        }
       
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

    private static final String IDP_CONFIG = "idpConfig";
    private static final Logger LOG = LoggerFactory
            .getLogger(ProcessHRDSExpressionAction.class);

    public String submit(RequestContext context) {
        IDPConfig idpConfig = (IDPConfig)WebUtils.getAttributeFromFlowScope(context, IDP_CONFIG);
        String hrds = idpConfig.getHrds();
        //TODO
        if (hrds == null) {
            LOG.info("HRDS is null (Mock).");
            return "";
        }
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        Assert.isInstanceOf(STSUserDetails.class, auth.getDetails());
        final STSUserDetails stsUserDetails = (STSUserDetails) auth.getDetails();
        SecurityToken securityToken = stsUserDetails.getSecurityToken();

        IDPConfig idpConfig = (IDPConfig)WebUtils.getAttributeFromFlowScope(context, IDP_CONFIG);

        WebUtils.putAttributeInExternalContext(context, idpConfig.getRealm(), securityToken);
        LOG.info("Token [IDP_TOKEN=" + securityToken.getId()
                + "] for realm ["
                + idpConfig.getRealm() + "] successfully cached.");
    }
View Full Code Here

Examples of org.apache.cxf.fediz.service.idp.model.IDPConfig

    private static final Logger LOG = LoggerFactory
            .getLogger(ValidateTokenAction.class);

    public SecurityToken submit(RequestContext context)
        throws ProcessingException, IOException {
        IDPConfig idpConfig = (IDPConfig) WebUtils.getAttributeFromFlowScope(
                context, IDP_CONFIG);

        if (idpConfig == null) {
            throw new ProcessingException("IDP configuration is null",
                    TYPE.BAD_REQUEST);
        }

        String whr = (String) WebUtils.getAttributeFromFlowScope(context,
                FederationConstants.PARAM_HOME_REALM);

        if (whr == null) {
            throw new ProcessingException("Home realm is null",
                    TYPE.BAD_REQUEST);
        }

        String wresult = (String) WebUtils.getAttributeFromFlowScope(context,
                FederationConstants.PARAM_RESULT);

        if (wresult == null) {
            throw new ProcessingException("No security token issued",
                    TYPE.BAD_REQUEST);
        }

        TrustedIDPConfig trustedIDPConfig = idpConfig.getTrustedIDPs().get(whr);

        if (trustedIDPConfig == null) {
            throw new ProcessingException(
                    "No trusted IDP config found for home realm " + whr,
                    TYPE.BAD_REQUEST);
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.