You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "waiphyodev (via GitHub)" <gi...@apache.org> on 2025/07/03 10:08:08 UTC

[I] 401 error in cloudstack createUser rest api [cloudstack]

waiphyodev opened a new issue, #11130:
URL: https://github.com/apache/cloudstack/issues/11130

   Hi, 
   
   My cloudstack api url for create user is like 
   
   http://cloudstack-host/client/api?account<account>&command=createUser&email=userthree%40mail.com&firstname=User&lastname=Three&password=password&response=json&username=userthree&signature=<signature>
   
   It rejects me with 401 
   It is happening only in createUser and createAccount APIs 
   If someone know what is happening here, I really appreciate for your help
   
   Thanks,
   
   #apache #cloudstack


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 401 error in cloudstack createUser rest api [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on issue #11130:
URL: https://github.com/apache/cloudstack/issues/11130#issuecomment-3034927225

   > GET (401 error) `http://host/client/api?apikey=<api-key>&command=createAccount&domainid=<domain-id>&email=userthree%40mail.com&firstname=User&lastname=Three&password=password&response=json&roleid=<role-id>&username=userthree&signature=<signature>`
   > 
   > POST (431 error) `http://host/client/api?apikey=<api-key>&command=createAccount&response=json&signature=<signature>`
   > 
   > with payload `{ email: 'userthree@mail.com', firstname: 'User', lastname: 'Three', username: 'userthree', password: 'password', roleid: '902f63f7-3235-11f0-8e75-2a84a8b381fa', domainid: '60afa7af-3235-11f0-8e75-2a84a8b381fa' }`
   
   `sessionkey` is needed i think


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 401 error in cloudstack createUser rest api [cloudstack]

Posted by "waiphyodev (via GitHub)" <gi...@apache.org>.
waiphyodev commented on issue #11130:
URL: https://github.com/apache/cloudstack/issues/11130#issuecomment-3034552304

   Thanks for reply.
   Yes, it does have required permissions to do request.
   What if I'm calling with API key, how should I give payload in which method.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 401 error in cloudstack createUser rest api [cloudstack]

Posted by "waiphyodev (via GitHub)" <gi...@apache.org>.
waiphyodev commented on issue #11130:
URL: https://github.com/apache/cloudstack/issues/11130#issuecomment-3034579044

   GET (401 error)
   `http://host/client/api?apikey=<api-key>&command=createAccount&domainid=<domain-id>&email=userthree%40mail.com&firstname=User&lastname=Three&password=password&response=json&roleid=<role-id>&username=userthree&signature=<signature>`
   
   POST (431 error)
   `http://host/client/api?apikey=<api-key>&command=createAccount&response=json&signature=<signature>`
   
   with payload
   `{
     email: 'userthree@mail.com',
     firstname: 'User',
     lastname: 'Three',
     username: 'userthree',
     password: 'password',
     roleid: '902f63f7-3235-11f0-8e75-2a84a8b381fa',
     domainid: '60afa7af-3235-11f0-8e75-2a84a8b381fa'
   }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 401 error in cloudstack createUser rest api [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland closed issue #11130: 401 error in cloudstack createUser rest api
URL: https://github.com/apache/cloudstack/issues/11130


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 401 error in cloudstack createUser rest api [cloudstack]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #11130:
URL: https://github.com/apache/cloudstack/issues/11130#issuecomment-3031685503

   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 401 error in cloudstack createUser rest api [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on issue #11130:
URL: https://github.com/apache/cloudstack/issues/11130#issuecomment-3031792327

   @waiphyodev , I suppose you left out the signature on purpose and did include it in your attempts to create a user.
   there is “account” between the URL and the rest of the parameters,
   my try looks like
   ```
   http://host/client/api/?command=createAccount&response=json&sessionkey=… 
   ```
   and is a post request with parameters.
   ```
   roleid=<role-id>&username=userthree&password=password&email=userthree%40mail.com&firstname=User&lastname=Three&domainid=<domain-id>
   ```
   if this seems ok,
   Have a look at the rights of the executing user, Do they have rights to this API. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org