using sardine for accessing a sharepoint website from a java application - java

SardineFactory.begin(username, password);
sardine.exists("http://mydomain.sharepoint.com/TeamSite/Documents");
I thought sardine can login auto but it returns 403 error.
I didn't use sardine and SharePoint Online before.
Remote Authentication in SharePoint Online Using Claims-Based Authentication
I know i should do something else but don't know how.
Anyone can help me?

The SharePoint is most likely using Claims-Based Authentication, which is a nightmare to negotiate and authenticate through using Java.
Most solutions I've seen from others (although I have not yet seen a working demo) claim you have to use a .NET "mediator" in a non-CBA environment that your Java app can communicate with, and the "mediator" will in turn more easily get through the CBA authentication routine (keeping things within the .NET family).
Being stubborn, I am working on a pure Java solution and will post if I ever get it working.

Related

Send facebook request from google endpoints

I've Googled around, though I can't seem to find an answer.
Currently using Google endpoints with android studio.
I'm looking to send a Facebook request via my backend server (java). (Assume i have the access token).
How can I achieve this?
please include code and examples of what you have tried to do already. Your questions needs to be specific about a programming issue. Right now it is too general.
Though I'm not 100% about this, I believe facebook doesnt allow this to work. Access tokens should not be shared. And servers shouldnt be able to pretend to be other clients.
Any allowed uses of the fb API will be done using the server's own access token, and not any other.

How to authenticate a mobile ADF application

How can I authenticate a user onto IIS. Actually my purpose is that an online user to make supply enter the application by using a kind of verification. And on the other hand we have Microsoft web system. So probably, I need to solve the authentication issue on IIS. Essentially I know how to secure and authentication AMX page within weblogic system. Basic HTTP Authentication is a standard though and ADF mobile useS it too. But can it handle my expectation, I cannot be sure.
What is the best practice and best way?
This is acutally a question to the IIS guys - all you need is a URL on that server that will prompt you for a basic authentication.

How to write a client in Java that will access a Dropbox account using its cloud API, OAuth, maybe libcurl, etc

I know very little about writing code for a client that would access a website account. I've been to different websites that contain so much information that I am just lost. Here is what I found:
For the client to take advantage of, say, remote file operations on
a Dropbox account, Dropbox's cloud API needs to be integrated.
But to do that, the client needs to receive an authentication token
with the OAuth 2.0 protocol.
Before I can do that, I have to establish an HTTP connection between
the client and the cloud.
Before I do that, I need to use libcurl or Java SDK for Dropbox.
Before I decide on whether to use libcurl, Dropbox Java SDK, or Java
standard libraries, I need to find out which one is better for HTTP
and SMTP protocols.
Now, correct me if I'm wrong on any of the numbered points above.
Here's a question: what library or SDK would you recommend me for using both HTTP and SMTP protocols? (I would have chosen Dropbox's Chooser as pointed out in the thread Client-only Dropbox access, but that's a JavaScript component, and my custom client app needs to take care of authentication and handle HTTP and SMTP requests.)
Any help is appreciated.
I've chosen the Java SDK for the Dropbox cloud storage provider. As pallandt has pointed out, the page https://www.dropbox.com/developers/core/start/java could get you started on what to do first to employ the Dropbox Java SDK:
Save the complete Main class code on the page to a java file.
On the same page find the link "install the Java SDK".
Follow the instructions on that page.
From there on comes a part of actually employing the SDK. The thread Cannot install a jar package without an IDE has comments under the OP that go off into a chat, which you may find really helpful. You might have to use an IDE like Eclipse to facilitate the importation of "com.dropbox.core".
I have been researching this for a while now and never really found a simple solution. This morning i tried something really simple and it actually worked.
public void testDropboxConnection() {
Path tmpF = Paths.get(System.getProperty("user.home") + File.separatorChar + "Dropbox//folder//");
try {
Files.createDirectories(tmpF);
} catch (IOException ex) {
Logger.getLogger(RefineryData.class.getName()).log(Level.SEVERE, null, ex);
}
}
I tested this and it sync's perfectly

Android: Downloading an NTLM-authentication-protected file

I want to download a file from a Sharepoint server that protected with NTLM authentication from my Android application. I found some tutorials and couldn't successful.
I tried using The Java CIFS Client Library and did not successful again.
I investigated this post: Manipulating SharePoint list items with Android (JAVA) and NTLM Authentication but i do not want to consume a webservice, i just want to download a file.
Any suggestions?
Did you use standard Java java.net.Authenticator http://developer.android.com/reference/java/net/Authenticator.html? If it doesn't support NTLM check http://developer.android.com/reference/org/apache/http/auth/NTCredentials.html and related org.apache.http package. Also look at blog http://mrrask.wordpress.com/2009/08/21/android-authenticating-via-ntlm/ where it is shown how to use it. In par
Why complicate things
You should be able to send the authentication in the Uri.
URL url = new URL ("http://user:pass#sub.domain.com/FolderName/FileName.docx");
This technique should work with both Windows Authentication and Basic Authentication
Try using Chilkat, although it's not free. but you can easily implement it in your code.
Chilkat Link

js- can i authenticate a user into my app using OAuth with only javascript->clientside, and js/java->server side?

I want to use OAuth in one of my apps, specifically a Google Chrome extension. Can it be done through JavaScript code? My only requirement is that it should be done with client side Javascript code, and the server can use either JavaScript or Java.
If this cannot be done, then can I use simple userid-password authentication?
Again, my only requirement is that it should be done with client side Javascript code, and the server can use either javascript or java.
You can definitely use OAuth in a Google Chrome extension, although bear in mind that your application keys and secrets will be readable in the bundle.
For more information: http://code.google.com/chrome/extensions/tut_oauth.html (the example uses one of Google's API enpoints but you could use any OAuth1.0a provider). Since you are interested in doing a Chrome extension you will not be affected by the normal hassle of request origin (cross site scripting) restrictions.
You can use "normal" userid and password authorization as well of course (especially over SSL/HTTPS). If you plan on going public with the APIs then I would recommend OAuth though.
JavaScript is pure client side scripting language. It cant be used in server side.
Second, If you want your client get authenticated there must be a server side program to do so.

Categories