none
Checking user credentials and failing nicely - HPC 2008 R2 SOA RRS feed

  • Question

  • Hi there,

    If I provide HPC with incorrect user credentials via the StartSessionInfo object I get an awful time-out error when trying to start the session. Is this normal behaviour? I would have expected an error informing the user that the credentials were not accepted..

    I would like to be able to check to see if the credentials a user has entered are valid, is there neat way to do this?

    Thanks in advance.

    James

    Monday, May 30, 2011 11:30 AM

Answers

  • I see. Probably you could try Session.SetInterfaceMode(false, new IntPtr(-1)) which will not retry in case the credential is wrong. If the credential is wrong, an exception "System error" would be thrown in Session.CreateSession, you could catch that exception and handle it yourself. Hope it helps.
    • Marked as answer by James.Wallace Tuesday, May 31, 2011 9:41 AM
    Tuesday, May 31, 2011 9:30 AM

All replies

  • Hi James,

    If user credential is not valid, there should be a credential dialog asking to retype the password.

    If you are running a console application, you should be asked to retype the password in the console.

    If you are running a GUI application, you should first set interface mode by Session.SetInterfaceMode(false,Inptr.Zero) before session creation.

    Could you help to see if the above helps? If not, please kindly provide more information such as your product version (rtm/sp1), sample code for creating the session, etc. 

    Monday, May 30, 2011 12:13 PM
  • Hi Mingqing,

    Thanks, based on what you have told me I think what has been happening is that the credentials have not been accepted and then the user was being prompted for correct credentials via the console which is not visible. Using the SessionBase.SetInterfaceMode(false,Inptr.Zero) prompts the user via a windows dialogue for the correct credentials. Although this is a possible solution to my problem, I would prefer it if I could detect when the credentials are incorrect and handle it with my own UI. Essentially I would like to catch an error and handle it myself.

     

    Any Ideas would be much appreciated :)

     

    Thanks

    James

    Tuesday, May 31, 2011 9:17 AM
  • I see. Probably you could try Session.SetInterfaceMode(false, new IntPtr(-1)) which will not retry in case the credential is wrong. If the credential is wrong, an exception "System error" would be thrown in Session.CreateSession, you could catch that exception and handle it yourself. Hope it helps.
    • Marked as answer by James.Wallace Tuesday, May 31, 2011 9:41 AM
    Tuesday, May 31, 2011 9:30 AM
  • Thanks Mingqing!

    That produced the result I was hoping for :)

    The exact exception produced is "System.Security.Authentication.InvalidCredentialException : System error" which I can handle gracefully within my code.

    Thanks again.

    James

    Tuesday, May 31, 2011 9:43 AM