It looks like there are two separate issues here:

On Mon, Oct 20, 2014 at 7:48 AM, philippe pithon <[email protected]>
 wrote:

> I must have 2 urls login :
> - userService.createLoginURL(.....)   ---> for
> EMF.get().createEntityManager()
> - GoogleAuthorizationCodeRequestUrl  ---> for upload Drive
>
> Ok or not ??? I can't do it one way ?
>


There are two different login URLs because you're asking the user to grant
privileges to two separate services: the Users API and the Drive client
library. They don't share authorizations. If you drop the Users login URL,
you have to manage user sessions by yourself or by using a framework. If
you drop the Drive auth URL, then you're missing out on the auth token to
access the user's Drive contents.

One of the reasons that I recommended the DrEdit sample application is that
it demonstrates how to manage a user's login status and access Drive. If
you look at the source code for the application,
<https://github.com/googledrive/dredit/blob/master/java/src/com/google/drive/samples/dredit/DrEditServlet.java>
you'll see functions such as loginIfRequired, getCredential, and so forth
showing how to handle the auth process depending on the user's current
logged-in status. Those are the functions you want to focus on, and
potentially use those instead of managing user sessions through the Users
API.

My recommendation is that you seem to be getting hung up on the Users API:
while the Users API is a fantastic service, there are other ways to handle
user sessions and you should investigate how DrEdit manages user sessions
even without access to the Users API. Once you understand how DrEdit
manages user sessions, you can drop one of the two login URL requirements
that you currently have.


On Mon, Oct 20, 2014 at 7:48 AM, philippe pithon <[email protected]>
 wrote:

> I use now CredentialManager for upload file to Drive... and it works
> But when I want to access EMF.get().createEntityManager() -> Could not
> initialize class
>


Can you post the entire exception, including the message and the stack
trace? Most likely you're either missing a file or there are conflicting
versions available to the app.


-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to