1

I'm using Oracle users to authenticate username and password for a .Net application. Right now I'm working on the password change function. The database has a custom password validation, so if you try to change a users password and, you provide an invalid password, Oracle returns multiple errors.

The first error is always "ORA-28003: password verification for the specified password failed", and then it rises one error for each failed validation. This is shown correctly when I try to change a user's password from the Toad client.

However, when I do this from my application, the OracleException that is risen only returns the first error, and therefore I'm not able to show the user what's invalid about the new password he provided.

According the ODP.Net documentation "[i]f there multiple errors, ODP.NET only returns the first error message on the stack." How can I avoid this? How can I show all the errors that occurred?

6
  • 2
    Im guessing one option would be to catch the exception thrown on the Oracle side and handle it accordingly in .Net with a custom re-thrown exception. Commented Feb 4, 2013 at 20:12
  • I think that would be the best solution, but to change the password i'm not using an stored procedure, i'm using the OpenWithNewPassword method from the OracleConnection class. Even if the password validation function rises only one error, Oracle rises two errors, the first one indicating that the verification failed, and then the error rised during the verification. And i'm only reciving the first one. Commented Feb 4, 2013 at 20:21
  • Well, I've had luck posting in the Oracle forums, you should try that as well, maybe theres a more straightforward solution :P Heres the link: forums.oracle.com/forums/forum.jspa?forumID=146&start=0 Commented Feb 4, 2013 at 20:26
  • Thanks! I'll do that, and post here if i get an answer. Commented Feb 4, 2013 at 20:33
  • 1
    We recently created this exact functionality. I can paste the code but because it's not relevant to the question of "multiple errors" it would probably be best if you started a new question specifically geared towards password change in oracle from .net. Commented Apr 4, 2013 at 18:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.