// Return the name of the login provider specified in this context, or empty
// string if none.
323179
func LoginProvider(ctx context.Context) string {
	name, _ := LoginProviderFrom(ctx)
	return name
}
584641
func (s *CookieStorer) GetValueForSessionName(r *http.Request, name string) (string, error) {
	c, err := r.Cookie(name)
	if err != nil {
		return "", err
	}
	return c.Value, nil
}
763819
func (c *Context) OAuthProvider() *OAuthProvider {

	service := c.Service()
	if c.ServiceBaseURL.Host == "" || c.ServiceBaseURL.Host == service.DefaultBaseURL.Host {
		return service.DefaultOAuthProvider()
	} else if c.ServiceBaseURL.Host != "" {

		p, _ := findOauthProviderByHost(c.db, c.ServiceBaseURL.Host)
		if p == nil {
			p = &OAuthProvider{BaseURL: c.ServiceBaseURL, Service: c.ServiceName}
		}
		/*if err != nil {
			c.Log().WithError(err).WithField("host", c.ServiceBaseURL.Host).Error("Can't get OAuthProvider")
		}*/

		return p
	}
	c.Log().Error("Can't get OAuthProvider – empty ServiceBaseURL")

	return nil
}
1121224
func (a *userNameAuthentication) Get(property string) string {
	switch property {
	case "username":
		return a.userName
	case "password":
		return a.password
	default:
		return ""
	}
}
1379
func WithLoginProvider(ctx context.Context, providerName string) context.Context {
	return context.WithValue(ctx, loginProviderNameKey, providerName)
}
136229
func (l *ProviderList) Provider(name string) (common.Provider, error) {

	// panic on nil
	if l == nil {
		panic(common.PrefixForErrors + "No providers have been initialised.  Make sure you have called gomniauth.WithProviders(...).")
	}

	for _, provider := range l.providers {
		if provider.Name() == name {
			return provider, nil
		}
	}

	return nil, &common.MissingProviderError{ProviderName: name}
}
960474
func (s *ServiceDescriptor) GetNamedMethod(name string) *MethodDescriptor {
	for _, m := range s.GetMethods() {
		if m.GetName() == name || m.GetLongName() == name {
			return m
		}
	}

	return nil
}
1279700
func Provider(host string) string {
	for provider, regex := range providerRegex {
		if regex.MatchString(host) {
			return provider
		}
	}

	return ""
}
1102948
func GetAuthServer(name string) AuthServer {
	authServer, ok := authServers[name]
	if !ok {
		log.Exitf("no AuthServer name %v registered", name)
	}
	return authServer
}
310422
func (c *Controller) GetLogin() mvc.Result {
	if c.isLoggedIn() {
		return c.logout()
	}
	return userLoginView
}
855555
func (c *Connect) GetHostname() (string, error) {
	var err C.virError
	str := C.virConnectGetHostnameWrapper(c.ptr, &err)
	if str == nil {
		return "", makeError(&err)
	}
	hostname := C.GoString(str)
	C.free(unsafe.Pointer(str))
	return hostname, nil
}
436371
func (user User) Name() string {
	return fmt.Sprintf("%s %s", user.FirstName, user.LastName)
}
318114
func (o *Organization) GetLogin() string {
	if o == nil || o.Login == nil {
		return ""
	}
	return *o.Login
}
655398
func (s *Session) Name() string {
	if s.sessionType == apitypes.MachineSession {
		return s.identity.(*envelope.Machine).Body.Name
	}

	return s.identity.(envelope.UserInf).Name()
}
806949
func (u *User) GetName() string {
	if u == nil || u.Name == nil {
		return ""
	}
	return *u.Name
}
72585
func (a *AuthorizationApp) GetName() string {
	if a == nil || a.Name == nil {
		return ""
	}
	return *a.Name
}
1298719
func (c *ServerContext) GetUsername() (string, error) {
	var ns _SecPkgContext_NativeNames
	ret := sspi.QueryContextAttributes(c.sctxt.Handle, _SECPKG_ATTR_NATIVE_NAMES, (*byte)(unsafe.Pointer(&ns)))
	if ret != sspi.SEC_E_OK {
		return "", ret
	}
	sspi.FreeContextBuffer((*byte)(unsafe.Pointer(ns.ServerName)))
	defer sspi.FreeContextBuffer((*byte)(unsafe.Pointer(ns.ClientName)))
	return syscall.UTF16ToString((*[2 << 20]uint16)(unsafe.Pointer(ns.ClientName))[:]), nil
}