Skip to main content
lozivi
New Member
February 11, 2026
Question

REST API WriteOfflineTokens: cannot proceed because of bad server response: 403

With FortiAuthenticator we have correctly installed everything for MFA with Windows. Login works properly, but the offline token is not working.

We have enabled everything according to the guide, and everything appears to be configured correctly, but in the log there is a 403 Forbidden error on the REST API call

I am attaching the log.

Could that be the reason why the offline token is not available? What could the issue be?

Thanks to anyone who can help me.

 

2026-02-11 10:47:05,149 [8900| 28|DEBUG] RestAPI: GetOfflineTokens queued asynchronously

2026-02-11 10:47:05,165 [6592|14024|INFO ] :  Credential::FetchEmergencyToken: Sending EmergencyTokenRequest to service

2026-02-11 10:47:05,165 [8900| 17|DEBUG] FAC_Agent.Service.Impl: Processing EmergencyTokenRequest for domain: xx, username: xx, UPN: xx

2026-02-11 10:47:05,180 [8900| 36|ERROR] TwoFactorAuthenticator: WriteOfflineTokens: cannot proceed because of bad server response: 403

...

2026-02-11 10:47:05,227 [8900| 36|DEBUG] RestAPI: Calling (SERVER_CONFIG)
2026-02-11 10:47:05,227 [8900| 36|ERROR] RestAPI: Failed to get configuration from server: 403 Forbidden
2026-02-11 10:47:05,243 [8900| 35|ERROR] RestAPI: An exception occurred during ReadHTTPResponseAsync: System.IO.IOException:  ---> System.Net.Sockets.SocketException: 
in System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
in System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
in System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
in System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
in System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
in System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
in System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count)
in FAC_Agent.RestAPI.RestAPIBase.ReadHTTPResponse(SslStream stream, DateTime sentUTC, UserObj user, Int32 count_in, Byte[] bytes_in)
in FAC_Agent.RestAPI.RestAPIBase.ReadHTTPResponseAsync(SslHelper sslHelper, DateTime sentUTC, UserObj user)

4 replies

Stephen_G
Staff & Editor
Staff & Editor
February 16, 2026

Hello lozivi,

 

Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible. 

Regards,
Stephen_G - Fortinet Community Team
tbarua
Staff
Staff
February 16, 2026

Hi lozivi, 

It is difficult to point out due to the missing logs. However, you can test the following;
-Delete all the offline token files on the installation folder
-or Open the FAC agent, select the simulation tab, down at the bottom select 'All' in the 'Delete Offline Token', then click the green go button.
To re-download, select the domain, enter the Username\password\OTP, then click the green go button.

- Additionally, if you have restriced host , then test with  allowing all host under FAC > System > Administration > System Access > Allow all hosts/domain

 

lozivi
loziviAuthor
New Member
March 10, 2026

 

Thank you very much, but now the problem remains that the emergency token still does not work.
From the log, it only shows an error saying:

  • "WriteEmergencyTokens: cannot proceed because of bad server response: 403"
  • "Failed to get configuration from server: 403 Forbidden"

I can't figure out what I need to authorize.

 

Thanks

 
 
2026-03-10 13:36:03,797 [3844| 34|ERROR] TwoFactorAuthenticator: WriteEmergencyTokens: cannot proceed because of bad server response: 403 Forbidden
2026-03-10 13:36:03,797 [3844| 38|DEBUG] RestAPI: Calling (SERVER_CONFIG)
2026-03-10 13:36:03,812 [3844| 38|ERROR] RestAPI: Failed to get configuration from server:403 Forbidden

 

Staff
March 31, 2026

hi @lozivi 

check if the realm configuration is the same in FAC and Windows agent.

When you simulate the authentication process from the Agent, is it working or the error message is the same?

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT