ruby-samples icon indicating copy to clipboard operation
ruby-samples copied to clipboard

Error 400 following admin_sdk directory quickstart

Open RulerOf opened this issue 3 years ago • 3 comments

Expected Behavior

I should be able to complete OAuth flow and get a list of users.

Actual Behavior

When I click on the URL I receive in my console, I get a notice that the OAuth out-of-band (OOB) flow has been deprecated.

Clicking details shows the following: image

Steps to Reproduce the Problem

  1. Create a project.
  2. Give it admin SDK permissions.
  3. Create OAuth Credentials.
  4. Attempt to run admin_sdk/directory/quickstart.rb.

Specifications

  • Ruby 3.1.2
  • Mac OS Monterey

RulerOf avatar Feb 03 '23 22:02 RulerOf

What is the solution to that ?

randoum avatar Mar 19 '23 08:03 randoum

You have to implement a local webserver that listens for the OAuth traffic inside of your application. I found some code somewhere but set this project down because I don't have enough users to justify the time investment required to fix this particular problem, and so cannot use this API.

RulerOf avatar Mar 20 '23 00:03 RulerOf

You have to implement a local webserver that listens for the OAuth traffic inside of your application. I found some code somewhere but set this project down because I don't have enough users to justify the time investment required to fix this particular problem, and so cannot use this API.

I actually use the API from a script, so I won't implement a webserver. And I lack time too, so I implemented a temporary and hacky solution for now.

Thanks anyways, cheers.

randoum avatar Mar 20 '23 07:03 randoum

I actually use the API from a script, so I won't implement a webserver. And I lack time too, so I implemented a temporary and hacky solution for now.

Thanks anyways, cheers.

Can you please share your temporary and hacky solution? :blush: How did you overcome the Error 400 invalid_request above?

Thanks.

felixmarch avatar Feb 10 '25 13:02 felixmarch

Closing this issue as the repository is archived.

jpoehnelt avatar Nov 18 '25 23:11 jpoehnelt