Package org.apache.cxf.fediz.core.spi

Examples of org.apache.cxf.fediz.core.spi.RealmCallback


        if (wtRealmObj != null) {
            if (wtRealmObj instanceof String) {
                wtRealm = (String)wtRealmObj;
            } else if (wtRealmObj instanceof CallbackHandler) {
                CallbackHandler hrCB = (CallbackHandler)wtRealmObj;
                RealmCallback callback = new RealmCallback(request);
                hrCB.handle(new Callback[] {callback});
                wtRealm = callback.getRealm();
            }
        } else {
            wtRealm = extractFullContextPath(request); //default value
        }
        return wtRealm;
View Full Code Here


        Assert.assertEquals(TestCallbackHandler.TEST_HOME_REALM, hr);
       
        Object wtRealmObj = fp.getRealm();
        Assert.assertTrue(wtRealmObj instanceof CallbackHandler);
        CallbackHandler wtrCB = (CallbackHandler)wtRealmObj;
        RealmCallback callbackWTR = new RealmCallback(null);
        wtrCB.handle(new Callback[]{callbackWTR});
        String wtr = callbackWTR.getRealm();
        Assert.assertEquals(TestCallbackHandler.TEST_WTREALM, wtr);
       
        Object signInQueryObj = fp.getSignInQuery();
        Assert.assertTrue(signInQueryObj instanceof CallbackHandler);
        CallbackHandler siqCB = (CallbackHandler)signInQueryObj;
View Full Code Here

        for (int i = 0; i < callbacks.length; i++) {
            if (callbacks[i] instanceof HomeRealmCallback) {
                HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
                callback.setHomeRealm(TEST_HOME_REALM);
            } else if (callbacks[i] instanceof RealmCallback) {
                RealmCallback callback = (RealmCallback)callbacks[i];
                callback.setRealm(TEST_WTREALM);
            } else if (callbacks[i] instanceof WAuthCallback) {
                WAuthCallback callback = (WAuthCallback) callbacks[i];
                callback.setWauth(TEST_WAUTH);
            } else if (callbacks[i] instanceof WReqCallback) {
                WReqCallback callback = (WReqCallback) callbacks[i];
                callback.setWreq(TEST_WREQ);
            } else if (callbacks[i] instanceof IDPCallback) {
                IDPCallback callback = (IDPCallback) callbacks[i];
                callback.setIssuerUrl(new URL(TEST_IDP));
            } else if (callbacks[i] instanceof SignInQueryCallback) {
                SignInQueryCallback callback = (SignInQueryCallback) callbacks[i];
                Map<String, String> queryParamMap = new HashMap<String, String>();
                queryParamMap.put("pubid", "myid");
                queryParamMap.put("testenc", "<=>");
                callback.setSignInQueryParamMap(queryParamMap);
            } else {
                throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
            }
        }
    }
View Full Code Here

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

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
        for (int i = 0; i < callbacks.length; i++) {
            if (callbacks[i] instanceof RealmCallback) {
                RealmCallback callback = (RealmCallback) callbacks[i];
                String param = FederationConstants.PARAM_TREALM;
                String wtRealm = (String)callback.getRequest().getAttribute(param);
                if (wtRealm == null || wtRealm.length() == 0) {
                    LOG.debug("No wtrealm found in request");
                } else {
                    LOG.info("WTRealm '" + wtRealm + "' found in request");
                    callback.setRealm(wtRealm);
                }
            } else {
                throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
            }
        }
View Full Code Here

        if (wtRealmObj != null) {
            if (wtRealmObj instanceof String) {
                wtRealm = (String)wtRealmObj;
            } else if (wtRealmObj instanceof CallbackHandler) {
                CallbackHandler hrCB = (CallbackHandler)wtRealmObj;
                RealmCallback callback = new RealmCallback(request);
                hrCB.handle(new Callback[] {callback});
                wtRealm = callback.getRealm();
            }
        } else {
            wtRealm = extractFullContextPath(request); //default value
        }
        return wtRealm;
View Full Code Here

        for (int i = 0; i < callbacks.length; i++) {
            if (callbacks[i] instanceof HomeRealmCallback) {
                HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
                callback.setHomeRealm(TEST_HOME_REALM);
            } else if (callbacks[i] instanceof RealmCallback) {
                RealmCallback callback = (RealmCallback)callbacks[i];
                callback.setRealm(TEST_WTREALM);
            } else if (callbacks[i] instanceof WAuthCallback) {
                WAuthCallback callback = (WAuthCallback) callbacks[i];
                callback.setWauth(TEST_WAUTH);
            } else if (callbacks[i] instanceof IDPCallback) {
                IDPCallback callback = (IDPCallback) callbacks[i];
                callback.setIssuerUrl(new URL(TEST_IDP));
            } else if (callbacks[i] instanceof SignInQueryCallback) {
                SignInQueryCallback callback = (SignInQueryCallback) callbacks[i];
                Map<String, String> queryParamMap = new HashMap<String, String>();
                queryParamMap.put("pubid", "myid");
                queryParamMap.put("testenc", "<=>");
                callback.setSignInQueryParamMap(queryParamMap);
            } else {
                throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
            }
        }
    }
View Full Code Here

        Assert.assertEquals(TestCallbackHandler.TEST_HOME_REALM, hr);
       
        Object wtRealmObj = fp.getRealm();
        Assert.assertTrue(wtRealmObj instanceof CallbackHandler);
        CallbackHandler wtrCB = (CallbackHandler)wtRealmObj;
        RealmCallback callbackWTR = new RealmCallback(null);
        wtrCB.handle(new Callback[]{callbackWTR});
        String wtr = callbackWTR.getRealm();
        Assert.assertEquals(TestCallbackHandler.TEST_WTREALM, wtr);
       
        Object signInQueryObj = fp.getSignInQuery();
        Assert.assertTrue(signInQueryObj instanceof CallbackHandler);
        CallbackHandler siqCB = (CallbackHandler)signInQueryObj;
View Full Code Here

TOP

Related Classes of org.apache.cxf.fediz.core.spi.RealmCallback

Copyright © 2018 www.massapicom. 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.