Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Nariael
New Contributor II

Fortiauthenticator API : create localuser expires_at

Hi,

I have a problem with the RESTAPI to create a localuser on my Fortiauthenticator.

 

When i use the expires_at field, i get automatically an error :

Cannot add local user "toto" (Response: HTTP 400), Error: b'{"localusers": {"expires_at": ["Invalid time format. Time should be formatted using ISO-8601 (e.g. 2015-02-17T15:42:50.972335-08:00). If timezone is not given, time is assumed to be in UTC."]}}'

I'd tried with many format (with and without timezone, miliseconds), i also tried with the example... Nothing at all.

1 Solution
Nariael
New Contributor II

I've updated my authenticator from version 6.6.2 to version 6.6.3 and everything is working well now.

View solution in original post

6 REPLIES 6
ebilcari
Staff
Staff

I did a test in FAC 6.5.6, created from UI a local user and read its expiration with API. With the same attribute tried to create another user and is created successfully:

 

user creation.PNG

What value are you setting for this attribute?

- Emirjon
If you have found a solution, please like and accept it to make it easily accessible for others.
Nariael
New Contributor II

Hi Ebilcari,

 

I try with 2025-05-06T22:00:00.000000+02:00

I'm using a script (python) 

Capture d'écran 2025-05-06 181001.png

Nariael
New Contributor II

Capture d'écran 2025-05-06 181411.png

I also try with the example (only change the year) : 

2015-02-17T15:42:50.972335-08:00

2026-02-17T15:42:50.972335-08:00

ebilcari

I would suggest to do some test by using curl like mentioned in this section of the guide to isolate this time format issue, it is is related to FAC or the python script.

- Emirjon
If you have found a solution, please like and accept it to make it easily accessible for others.
Nariael
New Contributor II

It's the same :s

Capture d'écran 2025-05-07 142119.png

Nariael
New Contributor II

I've updated my authenticator from version 6.6.2 to version 6.6.3 and everything is working well now.

Announcements
Check out our Community Chatter Blog! Click here to get involved
Labels
Top Kudoed Authors