SIGN IN SIGN UP

Update GenerateSecretKeyRequired response_code

Currently, GenerateSecretKeyRequired is treated as 403 Forbidden, which
would incorrectly imply the session was not created, when it should be
treated as an informational message accompanying a successful session
creation (with 201 response code), exactly like PasswordChangeRequired.

According to the Redfish spec [1], page 202, 203 (Section 13.5.5):
* "Shall allow a session login without the Token property and include
  the @Message.ExtendedInfo in the response containing the
  GenerateSecretKeyRequired message. This indicates to the client
  that their session is restricted to performing only the
  GenerateSecretKey action on their ManagerAccount resource before
  access is granted."
* "Shall allow a POST operation on the VerifyTimeBasedOneTimePassword"
  action on the ManagerAccount resource associated with the account."
* "Shall allow a DELETE operation on Session resources representing
  open sessions associated with the account."
* "May allow GET operations on unauthenticated resources, such as
  the ServiceRoot resource."
* "For all other operations, the service shall respond with the HTTP
  403 Forbidden status code and an error response with the
  GenerateSecretKeyRequired message from the Base Message Registry."

Reference:
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0266_1.24.0.pdf#page=202&zoom=100,0,789

Tested By:
* Enabled Multi-Factor Authentication (system-wide option)
* When user tries to login with username and password, session is
  created (201 is returned), with GenerateSecretKeyRequired message
  in "@Message.ExtendedInfo"
* Any operations on restricted resources returned
  GenerateSecretKeyRequired with 403 Forbidden error code.

Change-Id: Iec6c925f04584b2cdd93aec743b04d6a8dbde4bc
Signed-off-by: Jishnu CM <jishnunambiarcm@duck.com>
J
Jishnu CM committed
f9563f663e678f3b7b408dc11d75cc8b7c6af779
Parent: d7744fe
Committed by Asmitha Karunanithi <asmitk01@in.ibm.com> on 7/17/2026, 4:38:58 AM