func LoginProviderFrom(ctx context.Context) (name string, ok bool) {
	name, ok = ctx.Value(loginProviderNameKey).(string)
	return
}
Return the name of the login provider specified in this context.
package auth
import (
	"errors"
	"fmt"
	"time"
	"github.com/mesos/mesos-go/api/v0/auth/callback"
	"github.com/mesos/mesos-go/api/v0/upid"
	"golang.org/x/net/context"
)
var (
	NoLoginProviderName = errors.New("missing login provider name in context")
)
func Login(ctx context.Context, handler callback.Handler) error {
	name, ok := LoginProviderFrom(ctx)
	if !ok {
		return NoLoginProviderName
	}
	provider, ok := getAuthenticateeProvider(name)
	if !ok {
		return fmt.Errorf("unrecognized login provider name in context: %s", name)
	}
	return provider.Authenticate(ctx, handler)
}
type loginKeyType int
const (
	loginProviderNameKey loginKeyType = iota
	parentUpidKey
	timeoutKey
)
func WithLoginProvider(ctx context.Context, providerName string) context.Context {
	return context.WithValue(ctx, loginProviderNameKey, providerName)
}