3-Legged OAuth - Getting Tokens

54 views
Skip to first unread message

Michael Rojas

unread,
Jul 28, 2011, 4:46:24 PM7/28/11
to google-app...@googlegroups.com
So I now know I need to use 3-Legged OAuth to utilize the Provisioning API with the.Net libraries. I have an idea of how to do it, by have someone log in and getting the token from a returning url, then using the token and keys to authorize the client. My question is can I get a token without having to do a url redirect and having someone sign in? The idea is to have an automatic process that has admin credentials for our Google Apps that can create and update users. The process will have the username and password already. Thanks in advance.

Claudio Cherubino

unread,
Jul 28, 2011, 4:57:04 PM7/28/11
to google-app...@googlegroups.com
Hi Michael,

The .NET GData client library doesn't include a sample that shows how to retrieve a 3-legged OAuth token, but the following links can help you understand how you can implement the flow yourself:


Please note that you can also use OAuth Playground to retrieve a token, store it and use it in your code without the need to have a url redirect.

Claudio


On Thu, Jul 28, 2011 at 1:46 PM, Michael Rojas <mroj...@my.msmc.edu> wrote:
So I now know I need to use 3-Legged OAuth to utilize the Provisioning API with the.Net libraries. I have an idea of how to do it, by have someone log in and getting the token from a returning url, then using the token and keys to authorize the client. My question is can I get a token without having to do a url redirect and having someone sign in? The idea is to have an automatic process that has admin credentials for our Google Apps that can create and update users. The process will have the username and password already. Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/7wNibeLeU-UJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Michael Rojas

unread,
Jul 29, 2011, 10:56:10 AM7/29/11
to google-app...@googlegroups.com
Thanks for the help Claudio. I seem to be on the right path.

Michael Rojas

unread,
Jul 29, 2011, 3:08:34 PM7/29/11
to google-app...@googlegroups.com
If I create and use a token through the OAuth Playground, how long is that token good for? So far I've used one for about 3 1/2 hours and it still works. I've also gotten all the authentication working and can use the Provisioning API through my code.

Right now the question I'm facing is I'm assuming the token will expire sometime, so I want to have a process to create a token when I need it (if that's even necessary). I've been looking through the GData Documentation, and I'll keep looking.

Claudio Cherubino

unread,
Jul 29, 2011, 4:05:35 PM7/29/11
to google-app...@googlegroups.com
The token will be valid until revoked from the UI.

Claudio

On Fri, Jul 29, 2011 at 12:08 PM, Michael Rojas <mroj...@my.msmc.edu> wrote:
If I create and use a token through the OAuth Playground, how long is that token good for? So far I've used one for about 3 1/2 hours and it still works. I've also gotten all the authentication working and can use the Provisioning API through my code.

Right now the question I'm facing is I'm assuming the token will expire sometime, so I want to have a process to create a token when I need it (if that's even necessary). I've been looking through the GData Documentation, and I'll keep looking.

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
Reply all
Reply to author
Forward
0 new messages