isac322 / OneDrive-SDK-java

OneDrive SDK for Java
MIT License
62 stars 20 forks source link

Problem with autologin #14

Open g3t0r opened 6 years ago

g3t0r commented 6 years ago

Always when I run application, it's opening page in browser with Microsoft login page. The same behaviour with both auto login on and off. Should it be like that? I hope there is a way to login without any user interaction.

isac322 commented 6 years ago

Because of auth policy of Microsoft(first diagram), there must be at least one user interaction. But I found a library that support caching the signin info. I think if caching saves its info into file, fallowing signin can be done silently for same user. Another way is sdk provide signin url and user past the url into browser and copy resulting auth info from browser to terminal.

By the way, name of autoLogin parameter is my mistake. What I meant was actually 'construct with signin'. I think I should change the name. :cry:

leandre84 commented 6 years ago

+1

Persisting and setting the refresh token should do the trick, however, getRefreshToken() on the Client instance always returns null in my environment (maybe it's related to OneDrive Business which I'm using?).

timoage commented 6 years ago

Hey Isac, are you planning to implement sign-in with refreshToken? Because not having it would mean a show stopper for me