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

Oauth blocked access #95

Open
shaktee opened this issue Mar 21, 2021 · 9 comments
Open

Oauth blocked access #95

shaktee opened this issue Mar 21, 2021 · 9 comments

Comments

@shaktee
Copy link

shaktee commented Mar 21, 2021

image

I am unable to get beyond the authorization part. I'm using my personal account and it has never previously reported any blocked apps.

@jonathan-chin
Copy link

I was finally able to get this working. I know that there's an unmerged PR that might have fixed this but it seems stuck in limbo. here's how I fixed it (it gets dirty):

  1. follow the installation and usage, specifically to get OAuth client credentials.
  2. request the following permission scopes: https://www.googleapis.com/auth/presentations, https://www.googleapis.com/auth/drive (might require more. I added a bunch but I think these 2 are the only ones needed)
  3. edit the source code: bin/md2gslides.js lines 129 and 130:
    const options = {                                                                                                                                                                                      
        clientId: 'YOUR CLIENT ID',                                                                                                              
        clientSecret: 'YOUR CLIENT SECRET',                                                                                                                                                          
        filePath: STORED_CREDENTIALS_PATH,                                                                                                                                                                 
        prompt: prompt,                                                                                                                                                                                    
    };

let me know if that works for you. I'm happy to help, since I rely on this pretty heavily and can imagine others might too.

@zseta
Copy link

zseta commented Aug 11, 2021

thanks @jonathan-chin it works for me. I wonder why clientSecret and clientId are hardcoded..

@rumiiinator
Copy link

rumiiinator commented Sep 14, 2021

Hi just want to have a quick follow up on this thread.
I tried the similar approach mentioned above, which let me enter this stage
image

After checking both permission, the page will be redirected to a page to copy the authorized code.
But every time I paste the code to the terminal, I will get the following errors:
Unable to generate slides: Error: EAGAIN: resource temporarily unavailable, read ... at generateSlides (....) { errno: -35, syscall: 'read', code: 'EAGAIN' }
Wonder anyone has any idea about how to overcome/walk around this ....?

@wescpy
Copy link
Contributor

wescpy commented Sep 21, 2021

Ok, I ran into this last night, dug around, and found out a few things:

  1. @jonathan-chin 's fix is legit. In fact, I told users the same thing last year, so it's an "old" fix.
  2. I also fixed this bug and the original one with this patch in Apr 2020 which was finally merged Jun 2021.
  3. However because the latest release tag is still v0.5, you're not installing the fix.
  4. IOW, @zseta the reason why it's hardcoded requiring the fix-by-hand, is because you've installed the version from Apr 2019, not from Jun 2021 or newer.
  5. Bottom-line: you either go w/the patch by hand, or you clone the repo, compile with npm run compile, then replace what's in your /usr/local/bin (or wherever you've got it installed) with the latest one which s/b in your bin after compilation.
  6. This bug will likely be closed as a dupe of the original one.
  7. I pinged the maintainer last night and asked them to rev the version, so hopefully this will be a non-issue soon, but if not, at least you know what to do now. :-)

@GuiMarthe
Copy link

No updates on this? Seems fixable, no?

@wescpy
Copy link
Contributor

wescpy commented Oct 22, 2021

Yes, it's fixable, but the maintainer is pretty busy these days, and there are 2 workarounds: a) the repo has working code or b) patch the release you installed w/npm. So just follow the instructions above until they get a chance to "cut" a new release (tag).

@alexpdp7
Copy link

alexpdp7 commented Jan 3, 2022

Also you can npm-install googleworkspace/md2googleslides instead of md2gslides. That will pull the latest from GitHub, and it seems to work correctly. Given that the instructions in the README are now invalid, I'd edit them to change the installation method until a release can be made.

@wangtiejun001
Copy link

wangtiejun001 commented Apr 23, 2022

2. googleapis

I still met the "This app is blocked" issue just as the snapshot that shaktee posted.

Is there anyone who can help to identify the possible mis-configurations from my below steps?
Thanks...

What I tried:

  1. OAuth client credential is generated.
  2. Permission scope is added(I opened all permission scopes for testing the OAth issue).
  3. bin/md2gslides.js is modifed.
  4. client_id.json file is copied to .md2googleslides folder.

More about my config:

  1. inorder to get the credential, I configured the consent screen which requires a https service:
    oauth_consent_screen_config
  2. For creating the OAuth Client ID, I used the "desktop app/web application" rather than "Computer Application" as mentioned in the README.md. Because I cannot find the item.
    OAuth_client_service_type

More about my env:

  1. A personal gcp account.
  2. I ran the code from my local pc, while blocked at the "This app is blocked" page.
  3. I then ran the code from the server which I run for the https service(to ensure the origin is the same as the domain i used for the consent screen), still not work.

@wescpy
Copy link
Contributor

wescpy commented Apr 23, 2022

Please read the comments above. The code works; there's no issue with your permissions. It's just that you're using the code from 2019. The maintainer is too tied up to cut another release, so use one of the alternative methods described in other comments for now.

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

No branches or pull requests

8 participants