Skip to content

JWT iat claim may cause "token used before issue" #209

@vlad-nefodov

Description

@vlad-nefodov

When manually setting the issuedAt (iat) claim in Stream Chat JWT tokens, authentication can fail with:

Image
userClient.CreateToken(
                    userId: command.UserId.ToString(),
                    expiration: DateTimeOffset.UtcNow.AddMinutes(streamChatConfiguration.TokenLifetimeMinutes),
                    issuedAt: DateTimeOffset.UtcNow);

I suspect this issue may be related to the lack of clock skew tolerance on the server side or a similar strict validation mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions