programmatically authenticate to uag protected sharepoint


  • I implemented code in tutorial “” for connecting to share point UAG.

    The steps are:

    <!   1.   Do a GET on https://sharepoint-url/

          3. Construct the UAG Login Page URL

          4. Do a POST to the UAG Login Page URL with the correct credentials along with the cookie

    <!  5. Then pass the cookie to the ClientContext’s underlying HTTP Request using the event handler.

    But at steps 3, I saw the response: ResponseURI={https://******/uniquesig74d2eedb23c7f230454e82cc09af6a67/uniquesig0/InternalSite/InternalError.asp?error_code=120}.

    More detail in step 3:

    Doing post to url: https://*****/uniquesig74d2eedb23c7f230454e82cc09af6a67/uniquesig0/InternalSite/Validate.asp

    Header: With content-type: “application/x-www-form-urlencoded” and cookie from previously step,

    Body data: user_name=aoomen&password=DivPOC2012!&repository=AD&resource_id=A711B034D2554B7DA4381528B2B44E83&login_type=2&site_name=portal&secure=1

    I guess at step 3, cookie is missing and in body data of the Post request user name and password may encrypted. But I don’t know how to correct it.

    The form of cookie is      “ASPSESSIONIDAQBDCQCQ=EOIMAKGCJJMGJIGKPLFANNON; uniquesig3F8C64226EC2178E706752F1A7D2642641F7519ED4D19D2A780BED79736963D02A31328F564A0ACDEFFA3380D8F58F60=EOIMAKGCJJMGJIGKPLFANNON; WhlWFLB={A711B034D2554B7DA4381528B2B44E83*B9316042BEFC425989CA947AB8A5788C}; WhlST=196000; NLSessionSportal=cdhUtIl6dxgGmABKXZk4L32prPFIY078Jxjen+r+hd59DN8irVOmt5x1YFpGyp5s+rnGc983SjSxYsDUKKcwzUTjZ2uKKqbp1C1+alVVDzSwqdRDsTX5VjpBXzVhlDCW”

    thanks for reply.

    Tuesday, January 28, 2014 9:11 AM