MSDN > Home page del forum > Windows Presentation Foundation (WPF) > Passing the Credentials/SessionId to a WPF Frame Control
Formula una domandaFormula una domanda
 

Con rispostaPassing the Credentials/SessionId to a WPF Frame Control

  • lunedì 4 agosto 2008 13.13Swathi Rao Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi,

    In a standalone application, I am using a WPF Frame control to display the content of a Web URL. Prior to displaying the content, I have methods that login to the server with some user credentials. When displaying the content of the WebUI Frame, I would like provide either the credentials or the session id of my web request in order to prevent it from showing me the Authentication dialog box and the dialog box to accept the server certificate.

    Could some one please suggest how one can modify the webRequest  before the Frame displays the content. I have tried to set the credentials and the session ID in the NavigatingCancelEventHandler. But that did not help either as NavigatingCancelEventArgs only provides a property to get the webrequest, and not update it.

    Regards,
    Swathi.

Risposte

  • martedì 5 agosto 2008 21.10Chango V. - MSFT Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    What kind of authentication does your server require - cookie-based, digest, Windows Integrated?

    You should be aware that there are two kinds of web requests involved when navigating a Frame to an HTML resource: first, a "managed" WebRequest, then the native Web Browser control's request via WinINet. The two networking stacks are generally independent, so you may have to "prime" WinINet with the authentication information too.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Contrassegnato come rispostaMarco Zhou venerdì 8 agosto 2008 10.13
    •  

Tutte le risposte

  • martedì 5 agosto 2008 21.10Chango V. - MSFT Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    What kind of authentication does your server require - cookie-based, digest, Windows Integrated?

    You should be aware that there are two kinds of web requests involved when navigating a Frame to an HTML resource: first, a "managed" WebRequest, then the native Web Browser control's request via WinINet. The two networking stacks are generally independent, so you may have to "prime" WinINet with the authentication information too.


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Contrassegnato come rispostaMarco Zhou venerdì 8 agosto 2008 10.13
    •  
  • lunedì 11 agosto 2008 13.57Swathi Rao Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi Chango,

    The problem is I am trying to create a Single-Sign On mechanism so that once the user is logged in from elsewhere in the application, opening the Frame control to display related data should not ask the user to sign in again. Hence I was trying to find a means to pass either the session id or the user credentials so that the Frame control can automatically authenticate the user.

    What I am still unclear about is how to modify the WebRequest used by the Frame.

    Regards,
    Swathi.


    • ModificatoSwathi Rao lunedì 11 agosto 2008 14.00Added a question
    •  
  • martedì 7 ottobre 2008 22.23jmyczek Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I am trying to do the same thing to log on to a web server that uses digest authentication.  Did you find a solution?
  • mercoledì 4 febbraio 2009 20.41Prerak Sanghvi Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Did anyone find a solution to this issue?  I'm trying to figure out any way to pass credentials to the frame control.  In the Frame.Navigating event, I see that WebRequest is exposed in the EventArgs, but setting credential information there does not seem to work either.
  • venerdì 3 luglio 2009 18.44Dhiogo Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    How can I do that??

    regards
    Dhiogo Brustolin