2

I have an application that I tested out with a self-created SharepointServer based on an Active Directory environment. For this I used the following code to authenticate with the Sharepoint server(which worked)

    public void authenticate() {
    Authenticator.setDefault (new Authenticator() {
        @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                logger.info("Authenticated with user: " + user + " and password: " + password);
                return new PasswordAuthentication (user, password.toCharArray());
            }
    });
}

Now however, they have given me access to an Office 365 environment with a Sharepoint site containing multiple files that have to be read through the API. They have given me a login and a password through which I can log on to the site and check to contents but I am not able to connect to this API (403 error). I have tried the

X-Forms_Based_Auth_Required=f 

as a header but also without success. Is there a way I can get my java program authenticated with this online sevice?

0

Google's Google Search Appliance is open sourced so you can use it as a nice working example of Office 365 authentication. See: https://github.com/googlegsa/sharepoint/blob/master/src/com/google/enterprise/adaptor/sharepoint/LiveAuthenticationHandshakeManager.java

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.