Vault Customization

Reply
Active Contributor
michael.collins2
Posts: 43
Registered: ‎03-30-2012
Message 1 of 4 (194 Views)
Accepted Solution

Is a message on failed login possible?

194 Views, 3 Replies
09-12-2012 07:15 AM

Is it possible to get a message on a failed login, such as

 

- license limit has been reached

- Vault database not found

- username and password not found

 

Thanks

Mike

 

PS I am using the WebServiceManager in Vault Professional 2013.

 

So for login errors, am I on the right path with something like:

 

try

{

    m_serviceManager =

    new WebServiceManager(newUserPasswordCredentials(

         server, vault, username, password, true));

}

 

catch (Exception ex)

{

  string errorCode;

  List<string> restrictionCodes;

     GetErrorAndRestrictionCodesString(ex, out errorCode, out restrictionCodes);

}

Employee
Redmond.D
Posts: 814
Registered: ‎12-12-2006
Message 2 of 4 (180 Views)

Re: Is a message on failed login possible?

09-13-2012 05:03 AM in reply to: michael.collins2

If something goes wrong with the login, you will get an exception when creating the WebServiceManager object.  Errors from the Vault server will have an error code.

http://justonesandzeros.typepad.com/blog/2011/11/getting-the-restriction-codes.html

 

If you want a human readable message, you will have to convert the error code to a human readable string.  You can provide you own messages or copy them from the SDK documentation.

http://justonesandzeros.typepad.com/blog/2012/01/better-error-messages.html

 



Doug Redmond
Software Engineer
Autodesk, Inc.
http://justonesandzeros.typepad.com/

Active Contributor
michael.collins2
Posts: 43
Registered: ‎03-30-2012
Message 3 of 4 (177 Views)

Re: Is a message on failed login possible?

09-13-2012 07:19 AM in reply to: Redmond.D

So for login errors, am I on the right path with something like:

 

try

{

    m_serviceManager =

    new WebServiceManager(newUserPasswordCredentials(

         server, vault, username, password, true));

}

 

catch (Exception ex)

{

  string errorCode;

  List<string> restrictionCodes;

     GetErrorAndRestrictionCodesString(ex, out errorCode, out restrictionCodes);

} 

Employee
Redmond.D
Posts: 814
Registered: ‎12-12-2006
Message 4 of 4 (167 Views)

Re: Is a message on failed login possible?

09-14-2012 05:26 AM in reply to: michael.collins2

Yes, that should work.  You can test it out pretty easliy.  Just log in with a bad password.



Doug Redmond
Software Engineer
Autodesk, Inc.
http://justonesandzeros.typepad.com/

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!