Skip to content

OAuth Token Management Issue #130

@B-HOLLEY

Description

@B-HOLLEY

I believe I've found an issue in Oauth2TokenManager.cs.

https://github.com/OneSpan/oss.sdk.net/blob/dev/src/SDK/Oauth/Oauth2TokenManager.cs#L33

Image

Notice the SDK thinks the oauth token expires in 2080. The issue seems to be with the following:
long unixEpochTime = (long)payloadJson["exp"]; DateTime tokenExpiresAt = DateTime.UtcNow.AddSeconds(unixEpochTime); DateTimeOffset now = DateTimeOffset.Now;

unixEpochTime is a timestamp (number of seconds from 1\1\1970). You're taking the number of seconds since 1970, and adding it to the current current UTC time, which setting the expiration way into the future. Since the token actually expires in 5 minutes, we cant wait until 2080 for the SDK to think the token is expired :)

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