{"action":"created","issue":{"url":"https://api.github.com/repos/cf-tm-bot/cli/issues/165","repository_url":"https://api.github.com/repos/cf-tm-bot/cli","labels_url":"https://api.github.com/repos/cf-tm-bot/cli/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/cf-tm-bot/cli/issues/165/comments","events_url":"https://api.github.com/repos/cf-tm-bot/cli/issues/165/events","html_url":"https://github.com/cf-tm-bot/cli/issues/165","id":182759796,"number":165,"title":"cloudfoundry/cli #881: Added possibility to use **different OAuth client** in cf cli - Story Id: 132225811","user":{"login":"cf-tm-bot","id":20690070,"avatar_url":"https://avatars.githubusercontent.com/u/20690070?v=3","gravatar_id":"","url":"https://api.github.com/users/cf-tm-bot","html_url":"https://github.com/cf-tm-bot","followers_url":"https://api.github.com/users/cf-tm-bot/followers","following_url":"https://api.github.com/users/cf-tm-bot/following{/other_user}","gists_url":"https://api.github.com/users/cf-tm-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/cf-tm-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cf-tm-bot/subscriptions","organizations_url":"https://api.github.com/users/cf-tm-bot/orgs","repos_url":"https://api.github.com/users/cf-tm-bot/repos","events_url":"https://api.github.com/users/cf-tm-bot/events{/privacy}","received_events_url":"https://api.github.com/users/cf-tm-bot/received_events","type":"User","site_admin":false},"labels":[{"id":448531483,"url":"https://api.github.com/repos/cf-tm-bot/cli/labels/feature","name":"feature","color":"ededed","default":false},{"id":448571513,"url":"https://api.github.com/repos/cf-tm-bot/cli/labels/finished","name":"finished","color":"172c51","default":false},{"id":448532347,"url":"https://api.github.com/repos/cf-tm-bot/cli/labels/uaa","name":"uaa","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-10-13T11:06:08Z","updated_at":"2016-11-30T19:06:32Z","closed_at":null,"body":"As a cli user, I want to be able to inject my own client id, secret and refresh token into ~/.cf/config.json and have that used to login and refresh the access token.\n\nPlease add a comment to this story what key names you will decide on.\n\nNote:\n* We will write out the default client id (\"cf\") ~/.cf/config.json; no attribute means we use this default. (rational for writing it out is that it's easier for people to see what the attribute name is if they want to change it (if adding it yourself, easy to mistype with casing, underscore vs dash, and when mistyped the CLI will use the default \"cf\"/\"\" without warning).\n* We will not write out the default client secret (\"\") value to ~/.cf/config.json.\n\n---------------\n## A/C:\n**Scenario:** Injection of new client id and secret\n&nbsp;&nbsp;**Given** I have logged in using `cf login`\n&nbsp;&nbsp;**And** then added attributes with my client id and secret in ~/.cf/config.json\n&nbsp;&nbsp;**When** I run a command like `cf oauth-token` that causes a UAA call\n&nbsp;&nbsp;**Then** the request uses this client id and secret.\n\n**Scenario:** New environment\n&nbsp;&nbsp;**Given** a new environment (i.e. no ~/.cf/config.json)\n&nbsp;&nbsp;**When** I run a command like `cf api` or `cf help` that causes the generation of ~/.cf/config.json\n&nbsp;&nbsp;**Then** the generated ~/.cf/config.json includes an attribute for the client id with value \"cf\"\n&nbsp;&nbsp;**And** the generated ~/.cf/config.json does **not** include an attribute for the client secret\n\n**Scenario:** User already logged in\n&nbsp;&nbsp;**Given** an environment where the user has logged in as a user with no admin role\n&nbsp;&nbsp;**When** I run a command like `cf oauth-token` that causes a token refresh\n&nbsp;&nbsp;**Then** the generated ~/.cf/config.json includes an attribute for the client id with value \"cf\"\n&nbsp;&nbsp;**And** the generated ~/.cf/config.json does **not** include an attribute for the client secret\n\n--------------\n[Github Pull Request #881](https://github.com/cloudfoundry/cli/pull/881)\n\n>The use case for this pull request is the following:\n>\n>in 18F we are forced to limit user password expiration period to 1 month due to government restrictions. However we want to allow our users to set up special accounts for continuous integration. For this accounts we want to provide our users long lived tokens, that will have large expiration time (more that 1 month, probably 6 month) In order to do this we are ...(message has been trimmed)\n\nFiled by [@s-matyukevich](http://github.com/s-matyukevich)\n\n---\n\nMirrors: [story 132225811](https://www.pivotaltracker.com/story/show/132225811) submitted on Oct 13, 2016 UTC\n- **Requester**: CF Gitbot\n- **Owners**: Nick Wei, Matthew Boedicker, Jeffrey Pak\n- **Estimate**: 3.0"},"comment":{"url":"https://api.github.com/repos/cf-tm-bot/cli/issues/comments/263964061","html_url":"https://github.com/cf-tm-bot/cli/issues/165#issuecomment-263964061","issue_url":"https://api.github.com/repos/cf-tm-bot/cli/issues/165","id":263964061,"user":{"login":"cf-tm-bot","id":20690070,"avatar_url":"https://avatars.githubusercontent.com/u/20690070?v=3","gravatar_id":"","url":"https://api.github.com/users/cf-tm-bot","html_url":"https://github.com/cf-tm-bot","followers_url":"https://api.github.com/users/cf-tm-bot/followers","following_url":"https://api.github.com/users/cf-tm-bot/following{/other_user}","gists_url":"https://api.github.com/users/cf-tm-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/cf-tm-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cf-tm-bot/subscriptions","organizations_url":"https://api.github.com/users/cf-tm-bot/orgs","repos_url":"https://api.github.com/users/cf-tm-bot/repos","events_url":"https://api.github.com/users/cf-tm-bot/events{/privacy}","received_events_url":"https://api.github.com/users/cf-tm-bot/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T19:06:32Z","updated_at":"2016-11-30T19:06:32Z","body":"Matthew Boedicker [commented](https://www.pivotaltracker.com/n/projects/892938/stories/132225811/comments/156881553) on Nov 30, 2016, 6.28 PM UTC:\n\n`@pt:dkoper` Is it ok to always include the secret when writing the defaults to the config file? The user may want to edit both and will benefit from having a template for both fields.\n\n<!--\nComment Id: 156881553\n-->"}}
{"actor":{"display_login":"cf-tm-bot"}}