0

I understand that to use the Admin SDK only works with OAuth2.0 protocol, which requires that the logged on to Google and use the credentials that are created in developer console. My situation is that I'm implementing a process to enlist employees in our application and create an account in google, but not all our users have admin permission to enlist google accounts.

I made my user functionality and working properly (because my user is admin) but when upload it to production, another user could not create the user accounts when creating an employee, send the error that had no permissions to use the resource / API, obviously this person did not have administrator permissions.

So how do I send the credentials of an administrator account from server-side so that they can create user accounts on google?

not what I mean? translated with Google Translate

Bladimir
  • 1
  • 1
  • You should probably add user administration rights to the users that need them instead. Sending around admin credentials sounds like a bad idea. – jeroen Oct 17 '14 at 17:11

2 Answers2

0

There are two options available:

1) Store an admin's credentials.

In this method, you have an admin account go through a special authorization flow, and store their access_token and refresh_token in your database. Whenever you need to make a request that requires admin privileges, use the admin's stored credentials instead of the user's credentials.

2) Use a service account to impersonate an admin.

Service accounts can be granted domain-wide authority, allowing them to impersonate any user in the domain. When you need to make a request that requires admin privileges, use the service account to impersonate a domain administrator.

Option #1 is much simpler to code against, but requires a special admin flow in your application.

Eric Koleda
  • 12,420
  • 1
  • 33
  • 51
-1

Open Google Console and select your project. You will find permission menu. When you will add a member at the time you have to give permissions there.

UtkarshBhavsar
  • 249
  • 3
  • 23