Examples of SimpleAuthenticator


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

     * Sets authentication credentials for the remote URL
     * @param username User name
     * @param password Password
     */
    public void setAuthentication(String username, char[] password) {
        this.setAuthenticator(new SimpleAuthenticator(username, password));
    }
View Full Code Here

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

            {
                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());
        }

        return null;
    }
View Full Code Here

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

     * Setup for the tests by allocating a Fuseki instance to work with
     * @throws IOException
     */
    @BeforeClass
    public static void setup() throws IOException {
        authenticator = new SimpleAuthenticator(USER, PASSWORD.toCharArray());
       
        realmFile = File.createTempFile("realm", ".properties");

        FileWriter writer = new FileWriter(realmFile);
        writer.write(USER + ": " + PASSWORD + ", fuseki\n");
View Full Code Here

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

     * @throws SQLException
     * @throws IOException
     */
    @BeforeClass
    public static void setup() throws SQLException, IOException {
        authenticator = new SimpleAuthenticator(USER, PASSWORD.toCharArray());

        realmFile = File.createTempFile("realm", ".properties");

        FileWriter writer = new FileWriter(realmFile);
        writer.write(USER + ": " + PASSWORD + ", fuseki\n");
View Full Code Here

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

    }
   
    @Test(expected = HttpException.class)
    public void graphstore_with_auth_02() {
        // Incorrect auth credentials
        DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(serviceREST, new SimpleAuthenticator("allowed", "incorrect".toCharArray()));
        accessor.getModel();
    }
View Full Code Here

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

    }
   
    @Test
    public void graphstore_with_auth_03() {
        // Correct auth credentials
        DatasetAccessor accessor = DatasetAccessorFactory.createHTTP(serviceREST, new SimpleAuthenticator("allowed", "password".toCharArray()));
        Model m = accessor.getModel();
        Assert.assertTrue(m.isEmpty());
    }
View Full Code Here

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

    protected DatasetGraphAccessor getAccessor()
    {
        DatasetGraphAccessor accessor;
        if (this.GRAPHSTORE_LOGIN != null)
        {
            HttpAuthenticator httpAuthenticator = new SimpleAuthenticator(
                    GRAPHSTORE_LOGIN, GRAPHSTORE_PASSWORD.toCharArray());
            accessor = new DatasetGraphAccessorHTTP(GRAPHSTORE_ENDPOINT,
                    httpAuthenticator);
        } else {
            accessor = new DatasetGraphAccessorHTTP(GRAPHSTORE_ENDPOINT);
View Full Code Here

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

    public List<String> getAllStoredGraphs() {
        String queryString = "SELECT DISTINCT ?g WHERE { GRAPH ?g { ?s ?p ?o } }";
        QueryExecution qexec;
        if (this.SPARQL_LOGIN != null)
        {
            HttpAuthenticator httpAuthenticator = new SimpleAuthenticator(
                    SPARQL_LOGIN, SPARQL_PASSWORD.toCharArray());
            qexec = QueryExecutionFactory.sparqlService(SPARQL_ENDPOINT,
                    queryString, httpAuthenticator);
        } else {
            qexec = QueryExecutionFactory.sparqlService(SPARQL_ENDPOINT,
View Full Code Here

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

     *            User name
     * @param password
     *            Password
     */
    public void setAuthentication(String username, char[] password) {
        this.setAuthenticator(new SimpleAuthenticator(username, password)) ;
    }
View Full Code Here

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

     *
     * @param user
     * @param password
     */
    public void setBasicAuthentication(String user, char[] password) {
        this.authenticator = new SimpleAuthenticator(user, password);
    }
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.