Skip to content

JwtClaims.setExpirationTimeMinutesInTheFuture() does not work #37

Description

@a1anw2

There is a bug with this. For some reason, it is looking for a float; well this is causing some problems with casting and long story short, it does not work correctly.

    private NumericDate offsetFromNow(float offsetMinutes)
    {
        NumericDate numericDate = NumericDate.now();
        float secondsOffset = offsetMinutes * 60;
        numericDate.addSeconds((long)secondsOffset);
        return numericDate;
    }

Needs to be rewritten

    private NumericDate offsetFromNow(int offsetMinutes)
    {
        NumericDate	nd = NumericDate.now();
	return nd.addSeconds( 60*offsetMinutes );
    }

As a work around you can manually call the method:

NumericDate	nd = NumericDate.now();
nd.addSeconds( 60*60*24 );
claims.setExpirationTime( nd );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions