Skip to content

Commit

Permalink
Service flag to store userauth even if rejected
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Jul 3, 2021
1 parent d1f7ee2 commit 4d5561f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions service/nanomdm/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Service struct {
// check-in message. See the Discussion section of
// https://developer.apple.com/documentation/devicemanagement/userauthenticate
sendEmptyDigestChallenge bool
storeRejectedUserAuth bool
}

// normalize generates enrollment IDs that are used by other
Expand Down Expand Up @@ -150,8 +151,10 @@ func (s *Service) UserAuthenticate(r *mdm.Request, message *mdm.UserAuthenticate
if err := s.updateEnrollID(r, &message.Enrollment); err != nil {
return nil, err
}
if err := s.store.StoreUserAuthenticate(r, message); err != nil {
return nil, err
if s.sendEmptyDigestChallenge || s.storeRejectedUserAuth {
if err := s.store.StoreUserAuthenticate(r, message); err != nil {
return nil, err
}
}
// if the DigestResponse is empty then this is the first (of two)
// UserAuthenticate messages depending on our response
Expand Down

0 comments on commit 4d5561f

Please sign in to comment.