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

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


    }
   
    @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

    }
   
    @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

     * 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

     *
     * @param user
     * @param password
     */
    public void setBasicAuthentication(String user, char[] password) {
        this.authenticator = new SimpleAuthenticator(user, password);
    }
View Full Code Here

     * 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

            {
                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

     * 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

     * @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

    }
   
    @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

TOP

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

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.