ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Password Validation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Password Validation

    Hi all,

    Can anyone give me some pointers about the QPWDVLDPGM.I checked the iSeriers Information but did not get whet i want.
    Is it possible to use the AS400 log in user name & password in a application programme and allow user to proceed further only if the user name and password is correct?
    Thanks
    Sudarshan

  • #2
    Re: Password Validation

    If you're looking for a way of checking user IDs and passwords, the Get Profile Handle (QSYGETPH) API validates user IDs and passwords. This API verifies that the indicated user ID and password are correct.
    Philippe

    Comment


    • #3
      Re: Password Validation

      Wow Philippe, I got what i wanted.Thanks a Ton.

      And i have one more problem..........isnt there any message that will tell that the checked user ID password is correct.I found only error messages.

      Regards
      Sudarshan Ramal
      Thanks
      Sudarshan

      Comment


      • #4
        Re: Password Validation

        There is a good chance that the question you are asking
        has already been asked. Please take the time to search
        the forum. By searching for QSYGETPH you would have found
        this :



        If you do find what you are searching for and it is helpful feel
        free to indicate via a post that the found information was
        helpful.

        take care
        jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Password Validation

          Sudarshan,
          The example that Jamie has pointed out should help you find a reply to your last question. I prefer to use a prototyped call and use my own definitons to avoid the terrible QSYSINC/QRPGLESRC ones though.
          Code:
                **----------------------------------------------------------------
                **  Get Profile Handle API
                **    The Get Profile Handle (QSYGETPH) API validates user IDs and
                **    passwords.
                **----------------------------------------------------------------
               D GetProfile      PR                  ExtPgm( 'QSYGETPH' )
               D   UserID                      10A   Const
               D   Password                    10A   Const
               D   Handle                      12A
               Db                                    Like( api_error )
               D   PassLength                  10i 0 options(*nopass) Const
               D   PassCCSID                   10i 0 options(*nopass) Const
          
                * Standard API error data structure
               D api_error       ds
               D  err_size                     10i 0 inz( %size( api_error ))
               D  err_length                   10i 0 inz(0)
               D  err_id                        7a
               D                                1a
               D  err_data                    128a
          
               C                   Eval      UserID = 'MYUSERID'
               C                   Eval      Password = 'MYPASSWORD'
          
               C                   Callp     GetProfile(UserID:
               C                                        Password:
               C                                        handle:
               C                                        api_error:
               C                                        %len(%trim(Password)):
               C                                        0    )
               C                   if        err_length > 0
               C******                   There is an error here on UserID and/or Password
               C                                ...
          Philippe

          Comment


          • #6
            Re: Password Validation

            Thanks Philippe.This what i required.This solved me the problem.I had a tough time with it for a couple of days.Thanks a lot.

            Jameif ......sorry for that....... i havent searched for it.
            Will take care of it next time.

            Bye.
            Thanks
            Sudarshan

            Comment

            Working...
            X