Search code examples
google-oauthspinnakerspinnaker-halyard

Accessing Spinnaker gate api which authenticated with google OAuth2.0


I have deployed the Spinnaker services and set its authentication by using google oauth2.0 services.

Now I wanna access the gate api by writing custom nodejs javascripts.

So the question is I donnot know how to let my request/http scripts access the gate apis without interactive google auth actions, like using something like setting a token in the request's header?.

I have read the docs about IAP part, but I really do not quite understand what I need to setup in Spinnaker and how can I write my request scripts.

Any help would be very appreciated.

Thanks in advance.


Solution

  • since you have already integrated OAuth in Spinnaker, verify if your Gate services open. Spinnaker Gate would open on port 8084 by default. The Spinnaker Gate url would be something like this https://:8084/swagger-ui.html#/ or use "http>://" if you are on http. It would ask you to login. Try opening it and if it opens your Gate is working fine. you can try out any Spinnaker API too from this swagger page. It should work without any re-login as you are already logged in.

    now, to run APIs from code (or any script) you need to have an access token passed in the header. follow any standard oauth 2 document to see the procedure. you can take cues from here. https://www.jhanley.com/google-oauth-2-0-testing-with-curl/