Documentation ¶
Index ¶
Constants ¶
View Source
const CSRFTokenHeader = "X-CSRF-Token"
CSRFTokenHeader is a marker header that indicates we are not a browser that got tricked into requesting basic auth Corresponds to the header expected by basic-auth challenging authenticators
Variables ¶
This section is empty.
Functions ¶
func RequestToken ¶
func RequestToken(clientCfg *kclient.Config, reader io.Reader, defaultUsername string, defaultPassword string) (string, error)
RequestToken uses the cmd arguments to locate an openshift oauth server and attempts to authenticate it returns the access token if it gets one. An error if it does not
Types ¶
type BasicChallengeHandler ¶
type BasicChallengeHandler struct { // Host is the server being authenticated to. Used only for displaying messages when prompting for username/password Host string // Reader is used to prompt for username/password. If nil, no prompting is done Reader io.Reader // Writer is used to output prompts. If nil, stdout is used Writer io.Writer // Username is the username to use when challenged. If empty, a prompt is issued to a non-nil Reader Username string // Password is the password to use when challenged. If empty, a prompt is issued to a non-nil Reader Password string // contains filtered or unexported fields }
func (*BasicChallengeHandler) CanHandle ¶
func (c *BasicChallengeHandler) CanHandle(headers http.Header) bool
func (*BasicChallengeHandler) HandleChallenge ¶
Click to show internal directories.
Click to hide internal directories.