0

I am trying to Impersonate user based on current session user but getting nothing on

string identityName = HttpContext.Current.User.Identity.Name;

identityName variable is empty.

currently we are using Tridion Sites 9.1, and it is enabled with adfs SAML 2.0.

custom page webapplication is added under Tridion Sites -> Custom Page

Could someone please help/suggest me on this.

5
  • 2
    Possible duplicate of tridion.stackexchange.com/questions/19566/… Mar 24, 2022 at 12:58
  • Thanks @RickPannekoek, was able to get current user from given article. :) Mar 29, 2022 at 5:54
  • after getting current user I am getting access denied while trying to create core-service session, is it because SAML configuration? looked into this article as per this I believe core-service does not support SAML tridion.stackexchange.com/questions/21218/… Mar 29, 2022 at 5:54
  • Well, "it's complicated" :-) Core Service does support SAML to some extent (it has so-called Federation bindings which let you pass an entire Claim Set in the form of a SAML token). But if impersonating by user name is sufficient, you can do that (using the user named obtained like above). Mar 29, 2022 at 15:05
  • I think in this scenario there is no connection between the current user (i.e. a Windows user accessing your custom page) and the AD user which has access to Tridion. I don't see how HttpContext.Current.User.Identity.Name would get you anywhere. To impersonate the user you probably need to look for a claim in the request somewhere - IF that is being set in the first place.
    – Quirijn
    Mar 30, 2022 at 9:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.