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

Provide OAuth Token #4

Open
idoshamun opened this issue Aug 29, 2017 · 3 comments
Open

Provide OAuth Token #4

idoshamun opened this issue Aug 29, 2017 · 3 comments

Comments

@idoshamun
Copy link

How can I provide an oauth token?
roer is always redirected to the login page

@cedbossneo
Copy link

Same problem

@nextrevision
Copy link

nextrevision commented Nov 22, 2017

In 66bada2, the ability to specify an API session token was added.

It's more of a workaround, but I've done the following to be able to use roer when gate is configured to authenticate with GitHub:

  1. Create a personal access token for the account you wish to login to Spinnaker as (I gave the following permissions: read:org, read:user, user:email)
  2. Use the following script to obtain a session token:
curl -c cookies.jar -Lv https://gate:8084/credentials -H "Authorization: Bearer $GITHUB_PERSONAL_ACCESS_TOKEN”
SPINNAKER_API_SESSION=$(awk '/SESSION/ { print $NF }' cookies.jar)
  1. Use roer with the API session key:
$ SPINNAKER_API=https://gate:8084 roer --as ${SPINNAKER_API_SESSION} app list

@karlskewes
Copy link

karlskewes commented Jul 3, 2018

Thanks @nextrevision

I tried to replicate this with Gitlab OAUTH and also Gitlab Personal Access Tokens but was unsuccessful.

In the end I found another way to get an existing SESSION ID via Chrome browser.

  1. Sign in to Spinnaker via Deck (I have OAUTH enabled)
  2. Visit https://<your Deck URL>/pipelineTemplates in Chrome.
  3. Open Chrome developer tools.
  4. Reload page.
  5. View Network -> pipelineTemplates
  6. Search through the text for cookie: SESSION=<your session id here>
  7. Continue on with step 3 from above. You may need to export or prefix the roer command with SPINNAKER_API_SESSION.

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

4 participants