Skip to content

Commit b793ff6

Browse files
committed
IssueInstant should be UTC
Using SimpleDateFormat converts a date to local time, you need to setTimeZone on the formatter to fix this.
1 parent 06984a3 commit b793ff6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/com/onelogin/saml/AuthRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.net.URLEncoder;
1010
import java.text.SimpleDateFormat;
1111
import java.util.Date;
12+
import java.util.TimeZone;
1213
import java.util.Map;
1314
import java.util.UUID;
1415
import java.util.zip.Deflater;
@@ -34,6 +35,7 @@ public AuthRequest(AppSettings appSettings, AccountSettings accSettings){
3435
this.accountSettings = accSettings;
3536
id="_"+UUID.randomUUID().toString();
3637
SimpleDateFormat simpleDf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
38+
simpleDf.setTimeZone(TimeZone.getTimeZone("UTC"));
3739
issueInstant = simpleDf.format(new Date());
3840
}
3941

0 commit comments

Comments
 (0)