add challenging authentication needed for cli

Adds the ability to issue authorization challenges back to callers of /authorize.  This is done based on the value of client.RespondWithChallenges which indicates that a particular client wants to be challenged for responses instead of being redirected.

This also adds a few new cli commands (request-token, validate-token, whoami) to exercise the new capabilities.  Right now, the command line client only recognizes basic auth challenges, but the code point for future extension to other challenges is present.

@liggitt review
At the cost of duplication of code I guess.  This object probably belongs somewhere else - in a types object associated with the osin implementation.  Also, this object should either be part of our public api or just part of debugging.  Having weird middle ground api objects will just cause problems later on.


> On Nov 26, 2014, at 10:57 AM, David Eads <notifications@github.com> wrote:
> 
> In pkg/cmd/client/tokens/validate.go:
> 
> > +			if err != nil {
> > +				fmt.Printf("Error getting info result: %v\n", err)
> > +				return
> > +			}
> > +			whoami := string(whoamiBytes)
> > +			fmt.Printf("%v\n", whoami)
> > +
> > +			fmt.Printf("%v\n", string(body))
> > +		},
> > +	}
> > +	cmd.Flags().String("token", "", "Token value")
> > +	return cmd
> > +}
> > +
> > +type AccessData struct {
> > +	Error            string `json:"error" yaml:"error"`
> osin and osincli don't take advantage of the built in json encoding/decoding for objects. They first transform the data to an from maps. Having this object lets me go direct into an object with declarative encoding/decoding rules as opposed to using the osin way. See https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/RangelReale/osin/info.go#L66 and https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/RangelReale/osin/example/simple/simple.go#L104.
> 
> —
> Reply to this email directly or view it on GitHub.
>