Pentaho

 View Only
  • 1.  Pentao Api call from python create user but they can't connect

    Posted 03-22-2023 04:48

    Hello,

    I'm creating user from a python programm calling th pentao Api. My users are created but when they try to connect the system doesn't allow it until specifically change the password. 

    Did anyone had the same issue? 

    Best regards.

    the code :

        def CreateApiUser(self, userToCreate:User,pentaoAdminUser:User):
            self.url=self.baseAddress+"userroledao/createUser?Authorization=Basic MyAuthorizationEncoded"
           
            # A put request to the API
            user= { "userName" : userToCreate.nom, "password" :userToCreate.password  }
            response = requests.put(self.url,json=user,auth=(pentaoAdminUser.nom,pentaoAdminUser.password))
           
            print(response.status_code)


    ------------------------------
    vianney Maletras
    Systems Engineer
    interieur.gouv.fr
    ------------------------------


  • 2.  RE: Pentao Api call from python create user but they can't connect

    Posted 03-23-2023 02:24

    It is possible that the Pentaho API is requiring users to change their password upon initial login, which is a common security practice. You can verify this by checking the API documentation or contacting the Pentaho support team.

    To resolve the issue, you can modify your user creation code to set an initial password for the user that meets the password complexity requirements of the Pentaho system. Additionally, you can inform the users that they may need to change their password upon initial login to comply with the security policies of the Pentaho system.

    If the issue persists, you may need to further troubleshoot the Pentaho API and authentication settings to ensure that they are properly configured.   ManageMyHealth



    ------------------------------
    Diana Stanley
    Chief Financial Officer
    Glicks Furniture
    ------------------------------



  • 3.  RE: Pentao Api call from python create user but they can't connect

    Posted 03-24-2023 03:36

    Thanks for your reply Diana. 

    I don't think it's the right answer because when i create a user by command line with curl :

    curl -X PUT -u userName:password http://locahost:8080/pentaho/api/userroledao/createUser \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \

    -d '{ "userName" : "Test1", "password" : "test" }'

    Everything works fine  the user are created and can connect.

    But if i do it using python (cf. the code in my first post) or by calling curl from python the user are created but can't connect. The password seems correct because when as administrator i update the new user password using the one sent by mail then the user can connect. 

    Anyway i'll look into the api documentation once more. 

    ps. the curl code come from here "https://gist.github.com/StevenMMortimer/af77afdb74d0d6925b00"



    ------------------------------
    vianney Maletras
    Systems Engineer
    interieur.gouv.fr
    ------------------------------



  • 4.  RE: Pentao Api call from python create user but they can't connect

    Posted 03-27-2023 06:17

    I'm updating my original post. 

    From the curl command the only account that i can create from curl or using python who will be functionnal is an account with "Test_NUMBER" with the password test. Does anyone have any idea?

    ex Test1 /Test2



    ------------------------------
    vianney Maletras
    Systems Engineer
    interieur.gouv.fr
    ------------------------------