locked
retrieve username from Session RRS feed

  • Question

  • User496086301 posted

    I am using siteminder and trying to retrieve the userid

    protected void Page_Load(object sender, EventArgs e)
        {
            var headers = String.Empty;
            foreach (var key in Request.Headers.AllKeys)
                headers += key + "=" + Request.Headers[key] + Environment.NewLine;
            //TextBox1.Text = headers["USER_UID"];
            TextBox1.Text = headers;
            //TextBox2.Text = Request.Headers[KeyedByTypeCollection];

        }

    Now in textbox1 I am getting all the header info generated. How can I retrieve just the username/id/email..Tried above. Any suggestions much helpful.

    Thanks Much,

    Thursday, July 11, 2013 3:11 PM

Answers

  • User496086301 posted

    I did it like below

     NameValueCollection coll = HttpContext.Current.Request.Headers;
                 TextBox2.Text = coll["SMUSER"];

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 11, 2013 6:06 PM