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

ERROR: 403: Not Authorized to access this resource/api - forbidden #461

Closed
jhavens12 opened this issue Mar 30, 2017 · 19 comments
Closed

ERROR: 403: Not Authorized to access this resource/api - forbidden #461

jhavens12 opened this issue Mar 30, 2017 · 19 comments

Comments

@jhavens12
Copy link

The issue tracker is for reporting product deficiencies. "How do I?" questions should be posted to the discussion forum at https://groups.google.com/group/google-apps-manager. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

Full steps to reproduce the issue:

  1. gam info user XXXX

Expected outcome (what are you trying to do?):
I am trying to run any command with GAM
Actual outcome (what errors or bad behavior do you see instead?):
ERROR: 403: Not Authorized to access this resource/api - forbidden

I have uninstalled and reinstalled, created a new project and run through all of the install steps. My credentials pass when tested and this was working properly until it updated to 4.1 (Am on current 4.2 as of writing this and issue persists.)

@Katun79
Copy link

Katun79 commented Mar 30, 2017

Hello
You need to authorize this apis in your panel:

https://www.googleapis.com/auth/apps.groups.settings

Bye

@jhavens12
Copy link
Author

Thanks for the response but that link does not go anywhere

@taers232c
Copy link
Contributor

taers232c commented Mar 31, 2017 via email

@jhavens12
Copy link
Author

gam oauth info:

OAuth File: /Users/USER/bin/gam/oauth2.txt
client ID: XXX
Secret: XXX

Scopes (29):
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/admin.directory.group
https://www.googleapis.com/auth/admin.directory.orgunit
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.device.chromeos
https://www.googleapis.com/auth/admin.directory.device.mobile
https://apps-apis.google.com/a/feeds/emailsettings/2.0/
https://www.googleapis.com/auth/admin.directory.resource.calendar
https://www.googleapis.com/auth/apps.groups.settings
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/admin.reports.audit.readonly
https://www.googleapis.com/auth/admin.reports.usage.readonly
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/apps.licensing
https://www.googleapis.com/auth/admin.directory.user.security
https://www.googleapis.com/auth/admin.directory.notifications
https://www.googleapis.com/auth/siteverification
https://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/admin.directory.userschema
https://www.googleapis.com/auth/classroom.rosters
https://www.googleapis.com/auth/classroom.courses
https://www.googleapis.com/auth/classroom.profile.emails
https://www.googleapis.com/auth/classroom.profile.photos
https://www.googleapis.com/auth/classroom.guardianlinks.students
https://www.googleapis.com/auth/cloudprint
https://www.googleapis.com/auth/admin.datatransfer
https://www.googleapis.com/auth/admin.directory.customer
https://www.googleapis.com/auth/admin.directory.domain
https://www.googleapis.com/auth/admin.directory.rolemanagement
G Suite Admin: Unknown

gam user someuser@mydomain.com check serviceaccount:

User: someuser@mydomain.com
Scope: https://mail.google.com/ PASS
Scope: https://www.googleapis.com/auth/activity PASS
Scope: https://www.googleapis.com/auth/calendar PASS
Scope: https://www.googleapis.com/auth/drive PASS
Scope: https://www.googleapis.com/auth/gmail.settings.basic PASS
Scope: https://www.googleapis.com/auth/gmail.settings.sharing PASS
Scope: https://www.googleapis.com/auth/plus.me PASS

All scopes passed!
Service account XXX is fully authorized.

@jay0lee
Copy link
Member

jay0lee commented Mar 31, 2017 via email

@jhavens12
Copy link
Author

Thanks that did eventually work even though I had tried it earlier last week. so I'm not sure whats different now but it is working correctly. Thank you.

@kborecky
Copy link

This did the trick for me! (and I loved the self-destruct countdown :-) :-)

Thank you, Jay - and thanks for GAM! It's essential.

Karla B

@kc8zpi
Copy link

kc8zpi commented Nov 28, 2017

Jay, I'm having the same 403 issue with 4.32. I have run the oauth revoke and info domain a couple of times. I'm showing 30 scopes in my oauth info and the user I'm having issues with is showing PASS in all areas of check service account.

C:\GAM>gam info domain
Customer ID: C01smq76h
Primary Domain: xxx
Primary Domain Verified: True
Customer Creation Time: 2012-07-10T13:35:03.203Z
Default Language: en
Address:
organizationName: xxx
countryCode: US
Admin Secondary Email: xxx
User counts as of 2017-11-26:
Total Users: 3,283

C:\GAM>gam oauth info

OAuth File: C:\GAM\oauth2.txt
Client ID: xxx
Secret: xxx
Scopes (30):
https://apps-apis.google.com/a/feeds/emailsettings/2.0/
https://www.googleapis.com/auth/admin.datatransfer
https://www.googleapis.com/auth/admin.directory.customer
https://www.googleapis.com/auth/admin.directory.device.chromeos
https://www.googleapis.com/auth/admin.directory.device.mobile
https://www.googleapis.com/auth/admin.directory.domain
https://www.googleapis.com/auth/admin.directory.group
https://www.googleapis.com/auth/admin.directory.notifications
https://www.googleapis.com/auth/admin.directory.orgunit
https://www.googleapis.com/auth/admin.directory.resource.calendar
https://www.googleapis.com/auth/admin.directory.rolemanagement
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.security
https://www.googleapis.com/auth/admin.directory.userschema
https://www.googleapis.com/auth/admin.reports.audit.readonly
https://www.googleapis.com/auth/admin.reports.usage.readonly
https://www.googleapis.com/auth/apps.groups.settings
https://www.googleapis.com/auth/apps.licensing
https://www.googleapis.com/auth/apps.order
https://www.googleapis.com/auth/classroom.courses
https://www.googleapis.com/auth/classroom.guardianlinks.students
https://www.googleapis.com/auth/classroom.profile.emails
https://www.googleapis.com/auth/classroom.profile.photos
https://www.googleapis.com/auth/classroom.rosters
https://www.googleapis.com/auth/cloudprint
https://www.googleapis.com/auth/ediscovery
https://www.googleapis.com/auth/plus.me
https://www.googleapis.com/auth/pubsub
https://www.googleapis.com/auth/siteverification
https://www.googleapis.com/auth/userinfo.email
G Suite Admin: admin@beldingschools.org

C:\GAM>gam csv e:\export\google\brown-pass.csv gam update user ~Email password ~Password changepassword off >> RESULT-SetPasswords.txt
Using 1 processes...

ERROR: 403: Not Authorized to access this resource/api - forbidden

C:\GAM>gam user user@domain.com check serviceaccount
User: user@domain.com
Scope: https://mail.google.com/ PASS
Scope: https://www.googleapis.com/auth/activity PASS
Scope: https://www.googleapis.com/auth/calendar PASS
Scope: https://www.googleapis.com/auth/drive PASS
Scope: https://www.googleapis.com/auth/gmail.settings.basic PASS
Scope: https://www.googleapis.com/auth/gmail.settings.sharing PASS
Scope: https://www.googleapis.com/auth/plus.me PASS

All scopes passed!
Service account xxx is fully authorized.

C:\GAM>gam csv e:\export\google\brown-pass.csv gam update user ~Email password ~Password changepassword off >> RESULT-SetPasswords.txt
Using 1 processes...

ERROR: 403: Not Authorized to access this resource/api - forbidden

C:\GAM>

@taers232c
Copy link
Contributor

taers232c commented Nov 28, 2017 via email

@kc8zpi
Copy link

kc8zpi commented Nov 28, 2017 via email

@taers232c
Copy link
Contributor

taers232c commented Nov 28, 2017 via email

@kc8zpi
Copy link

kc8zpi commented Nov 28, 2017 via email

@taers232c
Copy link
Contributor

taers232c commented Nov 29, 2017 via email

@kc8zpi
Copy link

kc8zpi commented Nov 29, 2017 via email

@taers232c
Copy link
Contributor

taers232c commented Nov 29, 2017 via email

@kc8zpi
Copy link

kc8zpi commented Nov 29, 2017 via email

@kc8zpi
Copy link

kc8zpi commented Nov 29, 2017

Thanks for the help Ross.

@bffive
Copy link

bffive commented Oct 12, 2018

So I am getting the same error message when trying to run the "gam print guardians group" command. I reauthed, a couple times now, and no dice.
gam print admins user yields:
roleAssignmentId,roleId,role,assignedTo,assignedToUser,scopeType,orgUnitId,orgUnit
7575636725989494,7575636725989377,_SEED_ADMIN_ROLE,117726589875268706402,lhric.partenope@domainhere.org,CUSTOMER,,

@taers232c
Copy link
Contributor

taers232c commented Oct 12, 2018 via email

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

7 participants