AQ-AI / openaq-engine

http://www.aqai.xyz
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

:bug: URI mismatch error when sign-in to initialise earth engine app #27

Open ChristinaLast opened 1 year ago

ChristinaLast commented 1 year ago

steps to recreate

  1. `Log into AWS hosted repo
  2. git checkout 17-adding-satellite-data-features
  3. follow readme instructions until you successfully run openaq-engine --help
  4. run openaq-engine feature-builder
  5. you Should see the following message occur (with your user or AQAI root user
Screenshot 2022-11-18 at 08 20 51
ChristinaLast commented 1 year ago

Tried completing the following things;

  1. https://stackoverflow.com/questions/11485271/google-oauth-2-authorization-error-redirect-uri-mismatch
ChristinaLast commented 1 year ago

OpenID connect on top of OAuth2. when we click login the redirect mismatch, part of the initial URI needs to match the configuration. Raising a valid redirect URI.

ChristinaLast commented 1 year ago

Following this: https://dwdraju.medium.com/calling-google-cloud-services-from-aws-using-iam-roles-without-gcp-service-account-credentials-af918c05384d

ChristinaLast commented 1 year ago

Got to this with my user priveleges: image

ChristinaLast commented 1 year ago
/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/geopandas/_compat.py:112: UserWarning: The Shapely GEOS version (3.10.3-CAPI-1.16.1) is incompatible with the GEOS version PyGEOS was compiled with (3.10.1-CAPI-1.16.0). Conversions between both will be slow.
  warnings.warn(
service_account Here
Traceback (most recent call last):
  File "/home/ec2-user/2023/pollution_analysis_kurdistan/pollution_analysis/main.py", line 227, in <module>
    cli()
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/click/core.py", line 1126, in __call__
    return self.main(*args, **kwargs)
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/click/core.py", line 1051, in main
    rv = self.invoke(ctx)
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/click/core.py", line 1393, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/click/core.py", line 752, in invoke
    return __callback(*args, **kwargs)
  File "/home/ec2-user/2023/pollution_analysis_kurdistan/pollution_analysis/main.py", line 196, in load_satellite_data
    FlaringSatelliteFetcherFlow(processed_file).execute()
  File "/home/ec2-user/2023/pollution_analysis_kurdistan/pollution_analysis/main.py", line 76, in execute
    credentials.refresh(Request())
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/google/oauth2/service_account.py", line 438, in refresh
    access_token, expiry, _ = _client.jwt_grant(
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/google/oauth2/_client.py", line 312, in jwt_grant
    response_data = _token_endpoint_request(
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/google/oauth2/_client.py", line 283, in _token_endpoint_request
    _handle_error_response(response_data, retryable_error)
  File "/home/ec2-user/.cache/pypoetry/virtualenvs/pollution-analysis-kurdistan-LMfQlhl4-py3.10/lib/python3.10/site-packages/google/oauth2/_client.py", line 74, in _handle_error_response
    raise exceptions.RefreshError(
google.auth.exceptions.RefreshError: ('invalid_scope: Invalid OAuth scope or ID token audience provided.', {'error': 'invalid_scope', 'error_description': 'Invalid OAuth scope or ID token audience provided.'})