Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8387299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:10:24+00:00 2026-06-09T18:10:24+00:00

I have been working with Google-bigquery and JavaScript for a little time now, after

  • 0

I have been working with Google-bigquery and JavaScript for a little time now, after getting some help here, something i realised is that the you require your Google login details associated with the project to authorise and achieve what your trying to do.

What i am trying to achieve:-
Allow users to visit my page, and view the data. For example i may show some public data based on weather forecast, so i do not require any users authentication,

Currently for research & development purposed i am using I am using OAuth 2.0 for Web Server Applications, i want to get rid of this as we don’t need any user data, apart from having my project client-id email-id etc…

I have read on OAuth 2.0 for Server to Server Applications, and there don’t seem to be any support for JavaScript so the end-user doesn’t have to be involved.

Is there any solution to this or a safe quick fix, i have tried changing the config code from this sample to see what happens but no luck –

var config = {
            'client_id' : 'xxxxxxxxxxx.apps.googleusercontent.com',
            "iss" : "xxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com",
            "scope" : "https://www.googleapis.com/auth/bigquery",
            "aud" : "https://accounts.google.com/o/oauth2/token",
            "exp" : 1328554385,
            "iat" : 1328550785
        };

What am i missing in here.

Thanks in advance for any help and advice, i have been struggling for a very loong time with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:10:25+00:00Added an answer on June 9, 2026 at 6:10 pm

    Because there is no way to hide a client secret in client-side JavaScript code, there is no way to authorize a client-side JavaScript application to use BigQuery via a server-to-server OAuth flow.

    The only solution in this case is to use a server side proxy for your API calls from the JavaScript application. Here’s a snippet below of how you could proxy query calls via AppEngine (note: the code below is open to any user, it does do any check to make sure the calls are being run through your particular JavaScript client).

    import httplib2
    
    from apiclient.discovery import build
    from google.appengine.ext import webapp
    from google.appengine.ext.webapp.util import run_wsgi_app
    from oauth2client.appengine import AppAssertionCredentials
    
    # BigQuery API Settings
    SCOPE = 'https://www.googleapis.com/auth/bigquery'
    PROJECT_ID = 'XXXXXXXXXX' # REPLACE WITH YOUR Project ID
    
    # Create a new API service for interacting with BigQuery
    credentials = AppAssertionCredentials(scope=SCOPE)
    http = credentials.authorize(httplib2.Http())
    bigquery_service = build('bigquery', 'v2', http=http)
    
    
    class StartQueryHandler(webapp.RequestHandler):
      def post(self):
        query_string = self.request.get('query')
        jobCollection = bigquery_service.jobs()
        jobData = {
          'configuration': {
            'query': {
              'query': query_string,
            }
          }
        }
        try:
          insertResponse = jobCollection.insert(projectId=PROJECT_ID,
                                                body=jobData).execute()
          self.response.headers.add_header('content-type',
                                           'application/json',
                                           charset='utf-8')
          self.response.out.write(insertResponse)
        except:
          self.response.out.write('Error connecting to the BigQuery API')
    
    
    class CheckQueryHandler(webapp.RequestHandler):
      def get(self, job_id):
        query_job = bigquery_service.jobs()
        try:
          queryReply = query_job.getQueryResults(projectId=PROJECT_ID,
                                                 jobId=job_id).execute()
          self.response.headers.add_header('content-type',
                                           'application/json',
                                           charset='utf-8')
          self.response.out.write(queryReply)
        except:
          self.response.out.write('Error connecting to the BigQuery API')
    
    
    application = webapp.WSGIApplication(
                                         [('/startquery(.*)', StartQueryHandler),
                                         ('/checkquery/(.*)', CheckQueryHandler)],
                                         debug=True)
    
    def main():
      run_wsgi_app(application)
    
    if __name__ == "__main__":
      main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, Until now I have mostly been working with google maps v2. I am
I have been working with google maps and now have a requirement to make
I have been working with the google docs api found here: https://developers.google.com/google-apps/documents-list/#introduction This issue
I've been working with the PHP api for google Calendar, and have been getting
I have been working with Zend for a few months now and am at
I've been working with Google App Engine and I'm running into some slow performance
have been working and wearing out my fingers doing google searches with this one:
I have been working on some samples with ContentProviders, loaders, cursors and fragments. I
I have been working on this frustrating bug for a few days now and
I have some good experience with Google Analytics and have been using it for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.