Skip to content

Can loginByToken API use SAML-token/session-id to get session to vcenter using govmomi #3110

Closed Answered by dougm
jainrajiv02 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, you won't be using credentials again with client in that example. After the initial Login(), an http cookie is set and used to authenticate subsequent calls. It is transparent within the Go http.Client underneath, but if you need to use the session ID with another client:

		cookies := client.Jar.Cookies(client.URL())
		for _, cookie := range cookies {
			if cookie.Name == soap.SessionCookieName {
				fmt.Println(cookie.Value)
			}
		}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dougm
Comment options

Answer selected by tenthirtyam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants