Skip to content

Conversation

@jeremy-dl
Copy link

Short tutorial showing how to authenticate the Python client without using the command-line. This is useful for environments that may not have disk access, or where files persisted to disk may not reliably stick around (ex: Google Colab). Care should be taken not to save/accidentally share the refresh token info copied from https://iam.descarteslabs.com/auth/login?refresh_token=true&destination=/auth/refresh_token

@jeremy-dl jeremy-dl requested a review from karla-dl May 21, 2019 16:01
@karla-dl
Copy link
Contributor

@jeremy-descartes do you think this is an appropriate candidate to add to our public facing docs? I may have a platform engineer review it as well if that is the case as I have less knowledge of its implications.

@karla-dl
Copy link
Contributor

Also, thank you for contributing!

@jeremy-dl
Copy link
Author

jeremy-dl commented May 21, 2019 via email

@cmertes
Copy link

cmertes commented May 21, 2019

@jeremy-descartes, in Colab can't you just prepend a bash command with !? e.g.

!pip install descarteslabs
!descarteslabs auth login

You'll have to reinstall and re-authenticate each time of course. Can you give an example of a dev environment where this isn't feasible?

@jeremy-dl
Copy link
Author

jeremy-dl commented May 21, 2019 via email

@kornholi
Copy link
Contributor

what i've seen before:

import os
os.environ['DESCARTESLABS_CLIENT_ID'] = 'xxx'
os.environ['DESCARTESLABS_CLIENT_SECRET'] = 'xxx'
import descarteslabs as dl

however this will save the credentials back to disk. we can always reevaluate that decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants