mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 17:27:24 +00:00

# Which Problems Are Solved It is currently not possible to use SAML with the Session API. # How the Problems Are Solved Add SAML service, to get and resolve SAML requests. Add SAML session and SAML request aggregate, which can be linked to the Session to get back a SAMLResponse from the API directly. # Additional Changes Update of dependency zitadel/saml to provide all functionality for handling of SAML requests and responses. # Additional Context Closes #6053 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
60 lines
1.3 KiB
Go
60 lines
1.3 KiB
Go
package saml
|
|
|
|
import (
|
|
"google.golang.org/grpc"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
|
"github.com/zitadel/zitadel/internal/api/saml"
|
|
"github.com/zitadel/zitadel/internal/command"
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
saml_pb "github.com/zitadel/zitadel/pkg/grpc/saml/v2"
|
|
)
|
|
|
|
var _ saml_pb.SAMLServiceServer = (*Server)(nil)
|
|
|
|
type Server struct {
|
|
saml_pb.UnimplementedSAMLServiceServer
|
|
command *command.Commands
|
|
query *query.Queries
|
|
|
|
idp *saml.Provider
|
|
externalSecure bool
|
|
}
|
|
|
|
type Config struct{}
|
|
|
|
func CreateServer(
|
|
command *command.Commands,
|
|
query *query.Queries,
|
|
idp *saml.Provider,
|
|
externalSecure bool,
|
|
) *Server {
|
|
return &Server{
|
|
command: command,
|
|
query: query,
|
|
idp: idp,
|
|
externalSecure: externalSecure,
|
|
}
|
|
}
|
|
|
|
func (s *Server) RegisterServer(grpcServer *grpc.Server) {
|
|
saml_pb.RegisterSAMLServiceServer(grpcServer, s)
|
|
}
|
|
|
|
func (s *Server) AppName() string {
|
|
return saml_pb.SAMLService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) MethodPrefix() string {
|
|
return saml_pb.SAMLService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
|
return saml_pb.SAMLService_AuthMethods
|
|
}
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
|
return saml_pb.RegisterSAMLServiceHandler
|
|
}
|