Skip to content

Commit

Permalink
Merge pull request #42 from rabobank/MINOR_ERROR_HANDLING_IMPROVEMENT
Browse files Browse the repository at this point in the history
minor error handling improvement for empty UPN's (2)
  • Loading branch information
jcvrabo authored Jan 23, 2024
2 parents 5cff29f + f2d6b33 commit b05f9b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion user/azureAD_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ func (m *DefaultManager) SyncAzureADUsers(roleUsers *role.RoleUsers, usersInput
userID := userToUse.Upn
uaaUser := m.UAAUsers.GetByNameAndOrigin(userID, origin)
lo.G.Debugf("SyncAzureADUsers: Processing user: %s", userID)
if uaaUser == nil && userToUse.Upn != "" {
if userToUse.Upn == "" {
continue
}
if uaaUser == nil {
lo.G.Debugf("AAD User %s doesn't exist in cloud foundry, so creating user", userToUse.Upn)
if userGUID, err := m.UAAMgr.CreateExternalUser(userToUse.Upn, userToUse.Upn, userToUse.Upn, m.AzureADConfig.UserOrigin); err != nil {
lo.G.Errorf("Unable to create AAD user %s with error %s", userToUse.Upn, err.Error())
Expand Down

0 comments on commit b05f9b4

Please sign in to comment.