2023-10-21 19:36:50 +00:00
|
|
|
package connector
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/dexidp/dex/connector"
|
|
|
|
"github.com/dexidp/dex/pkg/log"
|
2023-10-29 12:29:48 +00:00
|
|
|
"github.com/dexidp/dex/storage"
|
2023-10-21 19:36:50 +00:00
|
|
|
)
|
|
|
|
|
2023-10-29 12:29:48 +00:00
|
|
|
const TypeRefuseAll = "refuseAll"
|
|
|
|
|
|
|
|
var RefuseAllConnectorConfig storage.Connector = storage.Connector{
|
|
|
|
ID: "null",
|
|
|
|
Name: "RefuseAll",
|
|
|
|
Type: TypeRefuseAll,
|
|
|
|
Config: nil,
|
|
|
|
}
|
|
|
|
|
2023-10-21 19:36:50 +00:00
|
|
|
type RefuseAllConfig struct{}
|
|
|
|
|
|
|
|
func (c *RefuseAllConfig) Open(id string, logger log.Logger) (connector.Connector, error) {
|
|
|
|
return &RefuseAllConnector{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type RefuseAllConnector struct{}
|
|
|
|
|
|
|
|
func (m *RefuseAllConnector) LoginURL(s connector.Scopes, callbackURL, state string) (string, error) {
|
|
|
|
return "", fmt.Errorf("you shouldn't use this function")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *RefuseAllConnector) HandleCallback(s connector.Scopes, r *http.Request) (identity connector.Identity, err error) {
|
|
|
|
return connector.Identity{}, fmt.Errorf("you shouldn't use this function")
|
|
|
|
}
|