func (g FormTokenGetter) GetToken(ctx context.Context) (*usso.SSOData, error) {
	if g.Name == "" {
		g.Name = "idmclient"
	}
	login, err := g.Filler.Fill(loginForm)
	if err != nil {
		return nil, errgo.Notef(err, "cannot read login parameters")
	}
	tok, err := server.GetTokenWithOTP(
		login[userKey].(string),
		login[passKey].(string),
		login[otpKey].(string),
		g.Name,
	)

	if err != nil {
		return nil, errgo.NoteMask(err, "cannot get token", isUSSOError)
	}
	return tok, nil
}
// GetToken uses filler to interact with the user and uses the provided
// information to obtain an OAuth token from Ubuntu SSO. The returned
// token can subsequently be used with LoginWithToken to perform a login.
// The tokenName argument is used as the name of the generated token in
// Ubuntu SSO. If Ubuntu SSO returned an error when trying to retrieve
// the token the error will have a cause of type *usso.Error.
GetToken uses filler to interact with the user and uses the provided
information to obtain an OAuth token from Ubuntu SSO. The returned
token can subsequently be used with LoginWithToken to perform a login.
The tokenName argument is used as the name of the generated token in
Ubuntu SSO. If Ubuntu SSO returned an error when trying to retrieve
the token the error will have a cause of type *usso.Error.
// GetToken uses filler to interact with the user and uses the provided // information to obtain an OAuth token from Ubuntu SSO . The returned // token can subsequently be used with LoginWithToken to perform a login . // The tokenName argument is used as the name of the generated token in // Ubuntu SSO . If Ubuntu SSO returned an error when trying to retrieve // the token the error will have a cause of type * usso . Error .
func (g FormTokenGetter) GetToken(ctx context.Context) (*usso.SSOData, error) {
	if g.Name == "" {
		g.Name = "idmclient"
	}
	login, err := g.Filler.Fill(loginForm)
	if err != nil {
		return nil, errgo.Notef(err, "cannot read login parameters")
	}
	tok, err := server.GetTokenWithOTP(
		login[userKey].(string),
		login[passKey].(string),
		login[otpKey].(string),
		g.Name,
	)
	if err != nil {
		return nil, errgo.NoteMask(err, "cannot get token", isUSSOError)
	}
	return tok, nil
}
func ( g FormTokenGetter ) GetToken ( ctx context . Context ) ( * usso . SSOData , error ) { if g . Name == " " { g . Name = " " } login , err := g . Filler . Fill ( loginForm ) if err != nil { return nil , errgo . Notef ( err , " " ) } tok , err := server . GetTokenWithOTP ( login [ userKey ] . ( string ) , login [ passKey ] . ( string ) , login [ otpKey ] . ( string ) , g . Name , ) if err != nil { return nil , errgo . NoteMask ( err , " " , isUSSOError ) } return tok , nil }
GetToken uses filler to interact with the user and uses the provided
information to obtain an OAuth token from Ubuntu SSO.
GetToken uses filler to interact with the user and uses the provided information to obtain an OAuth token from Ubuntu SSO .