Package org.apache.jena.atlas.web.auth

Examples of org.apache.jena.atlas.web.auth.PreemptiveBasicAuthenticator


            }
            return new FormsAuthenticator(logins);
        } else {
            // Do we want preemptive authentication?
            if (this.isTrue(props, PARAM_PREEMPTIVE_AUTH)) {
                return new PreemptiveBasicAuthenticator(new SimpleAuthenticator(user, password.toCharArray()));
            } else {
                // Use simple authenticator
                return new SimpleAuthenticator(user, password.toCharArray());
            }
        }
View Full Code Here


        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");

        // Auth credentials for valid user with correct password using
        // pre-emptive auth
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceQuery), "allowed", "password".toCharArray());
        qe.setAuthenticator(new PreemptiveBasicAuthenticator(authenticator));
        Assert.assertTrue(qe.execAsk());
    }
View Full Code Here

        // Auth credentials for valid user with correct password scoped to
        // correct URI
        // Also using pre-emptive auth
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceUpdate), "allowed", "password".toCharArray());
        ue.setAuthenticator(new PreemptiveBasicAuthenticator(authenticator));
        ue.execute();
    }
View Full Code Here

            {
                boolean preemptive = Boolean.parseBoolean(getServletContext().getInitParameter(GS.preemptiveAuth.getURI()).toString());
                if (preemptive)
                {
                    if (log.isDebugEnabled()) log.debug("Creating PreemptiveBasicAuthenticator for Context {} with username: {} ", serviceContext, usr);
                    return new PreemptiveBasicAuthenticator(new SimpleAuthenticator(usr, pwd.toCharArray()));
                }
            }

            if (log.isDebugEnabled()) log.debug("Creating SimpleAuthenticator for Context {} with username: {} ", serviceContext, usr);
            return new SimpleAuthenticator(usr, pwd.toCharArray());
View Full Code Here

        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");

        // Auth credentials for valid user with correct password using
        // pre-emptive auth
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceQuery), "allowed", "password".toCharArray());
        qe.setAuthenticator(new PreemptiveBasicAuthenticator(authenticator));
        Assert.assertTrue(qe.execAsk());
    }
View Full Code Here

        // Auth credentials for valid user with correct password scoped to
        // correct URI
        // Also using pre-emptive auth
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceUpdate), "allowed", "password".toCharArray());
        ue.setAuthenticator(new PreemptiveBasicAuthenticator(authenticator));
        ue.execute();
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.web.auth.PreemptiveBasicAuthenticator

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.