Hi,
I'm currently working on an internal web application (and a script or two) to allow our employees to change their password for both Google Apps and our own internal services (which rely on LDAP for authentication -- so each user has one common password across everything). The user will choose their new password from this web app, and the app will, in turn, change the password in Google Apps and other services.
Now, to do that on the GApps side, we're looking at using the user provisioning API (if there's a better way we're not aware of, don't hesitate to tell me). However, we're running into the following problems:
--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/zalim9blG6EJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.
Hello Max,You are right that User Provisioning API is used to update the password for the users in the Google Apps domain.Lets go through your problems one by one:
- Only read access is possible by 2-legged OAuth in the Provisioning API.
- You don't need to use ClientLogin. Infact, we recommend not to use ClientLogin.
Please use 3-legged OAuth with the Provisioning API. But then you will require to get the new passwords and save them before you run a script to update passwords from your end.As 3-legged OAuth requires the admin to authorize the request, the script must be executed by the admin as it requires admin to be logged in.
OAuthAuthorizeToken URL, which prompts them to log into their Google account." (the user being, in this case, an admin -- right?).
- CAPTCHA challenge usually occurs in ClientLogin if you authorize the service multiple times. Authorize the service just once and use the authorized service in all your methods.
- The passwords must be a minimum of 8 characters in length and maximum 100. The Limits section of the Provisioning API Developers Guide lists these limits. In your application, you can add a precondition for the passwords entered and only accept the correct length passwords.
-- Max--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/LYbYC5l2HM8J.
As 3-legged authorization requires the admin to authorize, the users wont be able to authorize to change their passwords.That is why, I recommended using Apps Script. You can get the new password from your application and save it in a Google Spreadsheet in the admin's account. If you have an Apps Script associated with spreadsheet, then you can trigger the script every time the content of spreadsheet changes so that script updates the password of the user.
Hi Max,
Try running the script from the script editor directly just once - it will prompt you for that authorization which will be reused when run from the trigger.
Cheers,
David Haley | Google Enterprise | Sales Engineer
Sent from my Android phone
Also, what privileges do I need to grant the user the Apps Script is running as, in order to allow usage of the UserManager class? In my preliminary tests, all calls to this class (from an onEdit trigger) fail with "Authorization is required to perform that action."-- Max
--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/88LZgXG79HwJ.
Shraddha,
Can you not use the 3-legged OAuth with an admin user and save the
refresh token. When a user then comes back, you can use the refresh
token to get an access token and continue to change the password. Is
this possible?
-- Max--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/Vj78kKS1TWMJ.
Hello Max,There is a step-by-step debugger in Script Editor. It can be used interactively.You can logging output, the best option would be to just create a plain text file and append text to it inside the function that is ran on the trigger.You can do that in combination with Logger.getLog().
-- Max--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/KK5AOOoD620J.