trifork / klg-docs

Public documentation for Gateway
0 stars 8 forks source link

Client authentication with signed JWT failed: Token is not active #15

Closed LindaLawton closed 2 years ago

LindaLawton commented 2 years ago

I was getting access tokens twenty minutes ago.

whats up?

LindaLawton commented 2 years ago

Its working again. Now i am just curious to the cause of the issue.

is this something i need to handle in my code just keep trying until you return a token?

nigtrifork commented 2 years ago

This is probably due to clock skew. Try increasing the validity of your jws

LindaLawton commented 2 years ago

I believe we discussed this in a previous post I am using the following as per that post.

  Expires = DateTime.Now.AddSeconds(500),
nigtrifork commented 2 years ago

OK, you probably also have to account for clock skew in the other direction, by setting nbf and iat a few seconds back in time

LindaLawton commented 2 years ago

This seams reasonably stable at this point

            IssuedAt = DateTime.UtcNow.AddMinutes(-5),
            NotBefore = DateTime.UtcNow.AddMinutes(-5),
            Expires = DateTime.UtcNow.AddMinutes(5),  

Do you have any issues with those times? Yes i switched it to UTC. However just setting it to UTC didn't fix it so I went back in time by a few minutes I could boost it to ten minutes. Yes i'm asking your opinion 😉

nigtrifork commented 2 years ago

yes this seems fine

LindaLawton commented 2 years ago

Unfortunately its not now i am getting forbidden. I was making access tokens with this all morning now its failing again.