1

In ITfoxtec SAML 2.0 implementation, Saml2PostBinding object has SetRelayStateQuery() and GetRelayStateQuery() methods to set and get data from dictionary.

Sometimes, GetRelayStateQuery() returns Empty dictionary even though I have set values using SetRelayStateQuery(). I am not able to reproduce this while testing but it is happening for many clients on production. In which scenarios may this happen?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
shrey shah
  • 43
  • 5

1 Answers1

0

The SetRelayStateQuery() should be used in the RP (relying party) and then the GetRelayStateQuery() in the IdP (identity provider). The methods should not be used in the samme application.

You can trace the error by looking at the SAML send between the parties.

Anders Revsgaard
  • 3,636
  • 1
  • 9
  • 25
  • 1
    I use SetRelayStateQuery() in login method to set email id and GetRelayStateQuery() in ACS method to retrieve stored email id . If this is not the right approach, can you suggest to me how to set some values at login time and retrieve the same when the user request comes to the ACS method ? (both the methods are at Service Provider's end) – shrey shah Jul 03 '20 at 15:35
  • It sounds like the right approach regarding setting and reading a value. Usually through, the e-mail/user id is part of the claims received in the ACS method. You would usually save a redirect url or session id in the relay state. – Anders Revsgaard Jul 08 '20 at 08:32