Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Colab authentication #1879

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Improve Colab authentication #1879

merged 1 commit into from
Jan 12, 2024

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Jan 12, 2024

This PR improves the Earth Engine authentication and initialization on Colab. If no Colab secrets are detected, use auth_mode="notebook". If the EE_PROJECT_ID serect is deteced, use auth_mode="colab" and ee.Initialize(project=EE_PROJECT_ID).

#1870 (comment)

Copy link

@github-actions github-actions bot temporarily deployed to pull request January 12, 2024 14:03 Inactive
@giswqs
Copy link
Member Author

giswqs commented Jan 12, 2024

It works as expected. Setting EE_PROJECT_ID as a Colab secret. It will use ee.Authenticate(auth_mode="colab") and ee.Initialize() without having to specify a project ID.

image

@giswqs giswqs merged commit 860e991 into master Jan 12, 2024
14 checks passed
@giswqs giswqs deleted the colab branch January 12, 2024 14:05
@jdbcode
Copy link
Collaborator

jdbcode commented Jan 12, 2024

This is a nice convenience feature! Between this and the reduced clicking of the auth_mode="colab" auth UI it gets people going pretty fast.

I really like your solution for saving the entire credentials though, personally, especially after adding a project to the credentials with earthengine set_project 'YOUR-EE-PROJECT'

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.

None yet

2 participants