CloudSync Credentials - Getting Google Drive Access Token to last more than 3600 seconds???

Matt Tyree

Explorer
Joined
Oct 11, 2016
Messages
82
I'm trying to figure out how to edit the access token to last more then 3600 seconds. I use the OAuth Playground to exchange the auth code for tokens, but it sets the expires_in to 3600 seconds. I can't even run a backup task in that time frame. How do you make the access token permanent. As in, never ask me to refresh it again. If I constantly have to check this, then it's not a good backup solution.

I've seen other threads that talk about setting the expires_in to 0 or 1. Which one? And if I simply change this in the CloudSync Credentials settings, it doesn't work. It still expires in an hour.

Is there a guide somewhere I how to set things up correctly. I'm a FreeNAS and Google API novice. This stuff is a little over my head, but I'm trying. :-D

Thanks!
 

Matt Tyree

Explorer
Joined
Oct 11, 2016
Messages
82
So, I'm gathering that the FreeNAS forums are not the place to go to ask about CloudSync. I have two threads asking questions about it and not a single answer. Not even a snarky one. :-/
 
D

dlavigne

Guest
It's possible it is a bug (or a doc bug). If you decide to create a ticket at bugs.freenas.org, post the issue number here.
 

Matt Tyree

Explorer
Joined
Oct 11, 2016
Messages
82
It's something to do with how you get the token from Google. It has a 3600 second expiration. Just changing the text of the expiration to something else doesn't work. I've googled it every way I can think of. I just have no clue how to extend the expiration, or, even better, allow it to refresh itself so the user never has to worry about it.
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
You ever get this figured out?

I'm at the same place as you. I've been doing the refresh token thing and have my oauth creds in there. not sure why it wasn't auto renewing.
 

Matt Tyree

Explorer
Joined
Oct 11, 2016
Messages
82
You ever get this figured out?

I'm at the same place as you. I've been doing the refresh token thing and have my oauth creds in there. not sure why it wasn't auto renewing.
Nope. Never did. I was hoping the last update would shed more light on it. No luck. It's maddening how little info there is out there on how to use the tokens. There has to be a way to auto refresh. I can't believe we actually have to continually go get a new token (which is a convoluted process already). I just couldn't find any documentation or tutorials on how to edit the timeout.

If you find a way, please let us know! :smile:
 
D

dlavigne

Guest
Did anyone ever create a bug report? If so, what is the issue number?
 

Matt Tyree

Explorer
Joined
Oct 11, 2016
Messages
82
I didn't create a bug report. I just assumed it was me not knowing how to set up the token properly. But, I guess there should be something in how FreeNAS/Cloudsync handles the token that should refresh it indefinitely.
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
this is kind of this issue https://ftp.freenas.org/issues/45479

In the comments other people are having this issue. Someone seemed to get it working but I don't really get how and I think they bypassed cloud sync and used rclone. But they also seem to be getting a different output in the oauth playground.
 

Matt Tyree

Explorer
Joined
Oct 11, 2016
Messages
82
this is kind of this issue https://ftp.freenas.org/issues/45479

In the comments other people are having this issue. Someone seemed to get it working but I don't really get how and I think they bypassed cloud sync and used rclone. But they also seem to be getting a different output in the oauth playground.
Kinda defeats the purpose of the dedicated cloud sync interface if you have to use rclone. At least we know we're not alone.

There's still something in the playground that seems too "locked" to me. As the name implies, it's for playing around with authentication and not really for creating tokens for projects. Probably just my inexperience talking. I just feel like getting a working token out of Google is a pain.
But still, even if the token lasts a day, the refresh portion should renew it. I'm not well-versed enough in these things to figure out what's missing.
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
Yeah, I totally agree. While it can probably be done some other way, I specifically want it to work this way.
 

Jr922

Explorer
Joined
Apr 22, 2016
Messages
58
I think the easiest way to do this is to not use the playground at all, and let rclone do it all,
run rclone config in the web or SSH shell, run through the options, dont give it any client ids or anything just leave it all blank,
when ur asked for autoconfig y/n hit n to get the headless link, copy that link into the browser of your choice. then it will prompt u to login, and u should have it.

when you're done you can simply copy the whole token line {xxxxxxx} and delete the remote config.
so you use rclone to generate the token since it has its own working Oauth setup, then you just copy it out and put it into the cloud credentials and use it in your cloudsync task
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
Interesting, I may give it a try but I'd really like this to be built into the cloud sync module instead.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
Has this been built into cloud sync or is the manual process still needed with the tokens/CLI? This seems to be much more complicated then it needs to be for just simple cloud sync.
 

Jr922

Explorer
Joined
Apr 22, 2016
Messages
58
Has this been built into cloud sync or is the manual process still needed with the tokens/CLI? This seems to be much more complicated then it needs to be for just simple cloud sync.

Still manual and there's probably not going to be a change in that soon. Also if you turn off the task for longer than the expiration you will have to reset. And I agree it's annoying but it really has to be done through cli anyway so they would have to build some type of frontend
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
Still manual and there's probably not going to be a change in that soon. Also if you turn off the task for longer than the expiration you will have to reset. And I agree it's annoying but it really has to be done through cli anyway so they would have to build some type of frontend

If its implemented it really should be done right but I digress. Do you know if this an issue with other services or just Google?
 

Jr922

Explorer
Joined
Apr 22, 2016
Messages
58
If its implemented it really should be done right but I digress. Do you know if this an issue with other services or just Google?
I agree, but I think the way it was meant to be was as a central interface to manage the prexisting cloud tasks a lot of people have running on vm's etc. and I think they are looking to try to compete with synology type simplicty but often run into the issue of needing to have custom solutions to run on freebsd and also within the webgui framework. e.g. there is no good frontend for rclone on freebsd that could just be dropped in that I know of.

It's any rclone tasks that we are talking about, some services have simpler authentication but basically you need to get on ssh and use rclone CLI to create a token or you could make a linux vm and use rclone within that and forget about the tasks.

but the easy way to get the proper token that refreshes itself is like 4 steps long, open the shell in the webgui or ssh in to the shell, type rclone config then new remote then run through all the default options then choose n for headless, open a webpage and authenticate with the given info then get token, go back to webgui and paste the token into the cloud credential under system tab.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
but the easy way to get the proper token that refreshes itself is like 4 steps long, open the shell in the webgui or ssh in to the shell, type rclone config then new remote then run through all the default options then choose n for headless, open a webpage and authenticate with the given info then get token, go back to webgui and paste the token into the cloud credential under system tab.

These changes are on the base OS and not in a jail correct? And they will survive reboots?
 

tstorm

Explorer
Joined
Jan 5, 2015
Messages
69
Yeah I agree, auth should be built it, however going in CLI and using rclone was pretty easy.
 
Top