gocd-contrib / google-oauth-authorization-plugin

The plugin allows user to login in GoCD using google account
Apache License 2.0
13 stars 7 forks source link

CLI login #184

Closed mccallumjeff closed 1 year ago

mccallumjeff commented 1 year ago

1) If this is implemented can some users still use user/pw or do ALL users have to be google oauth? 2) Is there a method of authorization I can use for cli to trigger parameterized builds via rest calls?

Thank you for the awesome plugin

chadlwilson commented 1 year ago
  1. Yeah, you can have multiple login methods allowed. For example if you look at https://build.gocd.org/ it allows regular username/pw login as well as GitHub OAuth login and Guest Login (3 different plugins). You will probably still want to think about how you map users to GoCD roles consistently across the login methods though.

  2. Generally the way to do this without relying on credentials is to create a "service account" style of local user with appropriate role, then generate a personal access token from via https://docs.gocd.org/current/configuration/access_tokens.html and use this bearer token for API access. The API you'd be looking for is https://api.gocd.org/current/#scheduling-pipelines or you could use one of the community SDKs or CLI type of experiences that talk to the API for you (although I dont have personal experience with those, so not sure which ones are in the optimal state)