Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityTokenValidFrom gives an exception #26

Closed
Krisser50 opened this Issue Feb 4, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@Krisser50
Copy link

commented Feb 4, 2019

Hello

I am having an error, and I think I have located the bug..

When I call: saml2AuthnResponse.CreateSession(HttpContext, claimsTransform: ClaimsTransform.Transform)
I get the error: ArgumentOutOfRangeException: The UTC time represented when the offset is applied must be between year 0 and 10,000

Which is coming from "saml2AuthnResponse.SecurityTokenValidFrom" in the CreateSession-function.

I can see that the type of saml2AuthnResponse.SecurityTokenValidFrom has been changed from DateTime to DateTimeOffset, and the service I call is not defining a "ValidFrom", and therefore the value is never set.

DateTimeOffset does not work with DateTime.MinValue

My work-around is this: (ITfoxtec.Identity.Saml2.Saml2AuthnResponse)
public DateTimeOffset SecurityTokenValidFrom { get { return Saml2SecurityToken.ValidFrom > DateTime.MinValue ? Saml2SecurityToken.ValidFrom : DateTime.UtcNow; } }

Then the system works, even if the assertion does not come with a ValidFrom-value

Best regards, and thanks for a great framework :)

Christian

@Revsgaard

This comment has been minimized.

Copy link
Contributor

commented Feb 4, 2019

Hi Christian

Thank you :)

I have added your code change 04f1f51

The change is part of the next version 3.0.1.

Best regards, and thanks again :)
Anders

@Revsgaard Revsgaard closed this Feb 4, 2019

@Revsgaard

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2019

Hi Christian

I have updated the code to both handle min and max related out of range protection 4319a20

Please let me know if this new change also solves your problem.

Best regards,
Anders

@Revsgaard Revsgaard reopened this Feb 6, 2019

@Krisser50

This comment has been minimized.

Copy link
Author

commented Feb 13, 2019

Hi Anders

Thanks for the update, and sorry for my late one. I haven't worked with the specific project this past week.

But I have tested the code now, and it seems to work just fine now :)

Thanks a lot

Best regards

Christian

@Revsgaard

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

Hi Christian

Thank you for testing the code :)

This issue is solved in release https://github.com/ITfoxtec/ITfoxtec.Identity.Saml2/releases/tag/3.0.1

Best regards,
Anders

@Revsgaard Revsgaard closed this Feb 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.