Job does not recognize new access token

Hi,

The R-client sometimes fails to pick up a new access token.
When I started working today, I successfully connected to https://openeo.cloud. A new access token was generated, see the screenshot from my EGI account.

As you can see, the access token expired at 8:43. Trying to re-connect after the expiry time created a new access token, see following screenshot:

Nevertheless I was unable to register my new job and execute it. R threw the error message Cannot provide access_token. You have to log in.Error in grep(id, x = log) : invalid 'pattern' argument.
I was able to solve this by restarting R and re-authenticating again.

Not sure what causes the problem, if it is the client or some authentication layer in between.
Any ideas or thoughts?
Best,
Hendrik

Two related follow-up questions:

  • How to deal with jobs that run longer than 15 minutes?
  • Is it necessary to have a browser tab open up to notify the user on “Authentication complete. Please close this page and return to R.”? The R console already informs the user with “Login successful”.

Hi Hendrik,
we’re looking into this here: OIDC Access Token does not work correctly · Issue #101 · Open-EO/openeo-r-client · GitHub
You can follow the development there, and as soon as solved we’ll answer here as well.
Thanks for bringing this up!

Thanks Peter, will keep track of the github issue

This seems related: Processing aborted repeatedly due to "Authorization token expired" - #5 by driesj

I digged into it, and the client did not get a refresh token from the back-end. This was due to the fact that the OIDC provider has not “offline_access” listed as scope. When setting it manually it will get a refresh token:

login(
  login_type = "oidc",
  provider = "egi",
  config = list(
    client_id = <client-id>,
    secret = <secret>,
    scopes = c("openid", "email", "eduperson_entitlement","offline_access")))
1 Like

I can also confirm that this works. After installing the develop branch we did not face any issues with the token today.

1 Like