AWS Thinkbox Discussion Forums

User create with password (SHA256)

Hi Support and Charles :slight_smile:

How are u Charles and Team :smiley:

I was annoyed because I couldn’t create a user.

user = '{"SendPopup": false, "JobFailed": true, "Name": "ahmettarik", "Service": "", "SendEmail": true, "JobCompleted": true, "RunAsHash": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "JobWarning": true, "SvcHash": null, "Machine": "MyPC", "RunAsName": "ahmettarik", "RunAsDom": "", "JobTaskTimeout": true, "_id": "ahmettarik", "Email": "support@render724.com"}'

mydeadline.Users.SaveUser(users) #return success

I failed…

Can you assign a sample json request to a password-protected account?

Verfy Thanks Charles and Suppoooort :slight_smile:

@Bobo, @MikeOwen Can you help me?

From a curl perspective I was able to create a new user this way:

data='{"_id":"somenew","Name":"somenew","Email":"noreply@amazon.com","SendEmail":false,"JobCompleted":true,"JobFailed":true,"JobWarning":true,"JobTaskTimeout":true,"Machine":"SomeMachine","SendPopup":false,"SvcHash":"","Service":"","RunAsName":"someone","RunAsDom":"","RunAsHash":""}'
curl -u serviceuser:password -X PUT -d "$data" http://10.1.2.3:8082/api/users

where ‘serviceuser’ and ‘password’ are the username and password.

I’m now checking to see how to provide those credentials via the Standalone Python API.

Seems it’s like so?

import Deadline.DeadlineConnect as Connect
mydeadline = Connect.DeadlineCon('WebServiceName', 8082)
mydeadline.SetAuthenticationCredentials('serviceuser', 'password', True)

See docs here.

You got it wrong :slight_smile: . I want to create a user. For example, I would like to create a user whose user name is ‘render724’, with password ‘123456’. How can I do it?

Ah. Currently you can inject the user but their password isn’t settable through the API. I did check for workarounds such as via deadlinecommand and the core API but it’s not available.

The curl command before actually did create a “somenew” user, but the password is only accessible via the Monitor interface.

I think you’ll have to have another system authenticate the users to your service and run from that.

I can add user from the monitor but can’t add from api …?

I can assigned from textbox of web service password… But api?

Hi @Bobo, @eamsler,

The problem still contiunes…

Thanks :slight_smile:

Unfortunately it’s not possible. The design of the system is such that the Monitor has access to deeper functions than have been exposed via the API. It has to do with our heritage in that the UI is not a consumer of a client API here.

Why is there still this endpoint? Please remove it from the document.

It allows you to do things such as import a user list but does not allow password changes.

I can understand your frustration. I believe the issues is that user authentication has not been a large enough customer requirement for password changing to be made a feature yet.

Hi eamsler :slight_smile:

Very thanks for clarification.

I have a question. Does this function work? --> Deadline.Users.UserInfo.UserWebServicePassword

https://docs.thinkboxsoftware.com/products/deadline/7.2/2_Scripting%20Reference/class_deadline_1_1_users_1_1_user_info.html

I am unsure at the moment. It would be saved by sending the UserInfo to SaveUserInfo.

This creates a user for me:

from Deadline.Scripting import RepositoryUtils
from Deadline.Users import UserInfo

USERNAME = 'edwin'
PASSWORD = 'pickles'

def __main__():
    user = RepositoryUtils.GetUserInfo(USERNAME, True)
    
    if user is None:
        print("Creating new user")
        
        user = UserInfo()
        user.UserName = USERNAME
    
    user.UserWebServicePassword = PASSWORD 
    RepositoryUtils.SaveUserInfo(user)

I’m not in a good spot to test at the moment. Can you give that a try? If it doesn’t work, I’ll try and build up a test jig and run some tests there. Also, please change the username and password. :slight_smile:

Woow very thanks but result :frowning:

{“Name”:“edwin”,“Email”:"",“SendEmail”:false,“JobCompleted”:true,“JobFailed”:true,“JobWarning”:true,“JobTaskTimeout”:true,“Machine”:"",“SendPopup”:false,“SvcHash”:null,“Service”:"",“RunAsName”:"",“RunAsDom”:"",“RunAsHash”:"","_id":“edwin”}

:frowning:

You’re right. I’ve double checked and changing that parameter does not get set when saving the user. It turns out there is a hidden function available! This works:

from Deadline.Scripting import RepositoryUtils
from Deadline.Users import UserInfo

USERNAME = 'edwin'
PASSWORD = 'pickles'

def __main__():
    user = RepositoryUtils.GetUserInfo(USERNAME, True)
    
    if user is None:
        print("Creating new user")
        
        user = UserInfo()
        user.UserName = USERNAME

    user.UpdateWebPassword(PASSWORD)
    RepositoryUtils.SaveUserInfo(user)
Privacy | Site terms | Cookie preferences