package org.sagebionetworks.repo.manager.oauth;

import java.util.Date;

import org.sagebionetworks.repo.model.oauth.OIDCClaimName;

import io.jsonwebtoken.impl.DefaultClaims;

public class ClaimsWithAuthTime extends DefaultClaims {
	
	public static ClaimsWithAuthTime newClaims() {return new ClaimsWithAuthTime();}
	
	private ClaimsWithAuthTime() {}

	public ClaimsWithAuthTime setAuthTime(Date authTime) {
		setDateAsSeconds(OIDCClaimName.auth_time.name(), authTime);
		return this;
	}
	
	public Date getAuthTime() {
		return get(OIDCClaimName.auth_time.name(), Date.class);
	}

}

@@ -514,22 +514,30 @@
 e() %7B%0A%09%09
-return
+Object value =
  get(OID
@@ -567,20 +567,268 @@
 me()
-, Date.class
+);%0A%09%09if (value == null) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09// The default implementation of get(name, Date) will not convert from seconds%0A%09%09// for %22non-standard%22 claims so we have to use the %22toSpecDate%22 ourselves%0A%09%09return toSpecDate(value, OIDCClaimName.auth_time.name()
 );%0A%09

Fix failing test due changes in library