Make SAML role mapping optional
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -77,12 +77,13 @@ func ExtractEmailDomain(email string) (string, error) {
|
||||
return domain, nil
|
||||
}
|
||||
|
||||
func MapSAMLRoleToSystemRole(samlRole string) coredata.Role {
|
||||
func MapSAMLRoleToSystemRole(samlRole string) *coredata.Role {
|
||||
if samlRole != "" && isValidRole(samlRole) {
|
||||
return coredata.Role(samlRole)
|
||||
role := coredata.Role(samlRole)
|
||||
return &role
|
||||
}
|
||||
|
||||
return coredata.RoleMember
|
||||
return nil
|
||||
}
|
||||
|
||||
func isValidRole(role string) bool {
|
||||
|
||||
@@ -407,7 +407,7 @@ func (s *SAMLService) InitiateSAMLLogin(
|
||||
type SAMLUserInfo struct {
|
||||
Email string
|
||||
FullName string
|
||||
Role coredata.Role
|
||||
Role *coredata.Role
|
||||
SAMLSubject string
|
||||
OrganizationID gid.GID
|
||||
SAMLConfigID gid.GID
|
||||
|
||||
Reference in New Issue
Block a user