Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User failed to authenticate when deactivating users

Hello.

I have a python script that I use to deactivate users periodically.

Suddenly it stops to work, I still can get a list of all the registered users but when I try to deactivate any of them I got the following message:

Error Deactivating USERNAME: JiraError HTTP 401 url: https://my_url/admin/rest/um/1/user/deactivate?username=USERNAME
text: User failed to authenticate

I am a administrator, I was using email/password but even when changed to email/token I got the same error.

The script is simple like that:

jira = JIRA(basic_auth=(atlassianEmail, atlassianToken),
#options={'server': 'https://my_url'})

jira.deactivate_user(USERNAME)

Do anyone have any ideas? 

4 answers

me too getting same issue can someone help??

I'm having the same issue.

I am able to disable user using below rest API.

 

https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-lifecycle-disable-post

 

you need to generate API @https://admin.atlassian.com/ -> settings

In order to manage user users, you have to verify your domain.

let's say your users contain email =  user@test.com,  you need to verify the test.com domain.

 

domain verification steps:
https://admin.atlassian.com/ -> directory->domains

you can disable /delete user from https://admin.atlassian.com/ ->directory->usermanagement

sample request

curl --request POST \ --url 'https://api.atlassian.com/users/<user_id>/manage/lifecycle/disable' \ --header 'Authorization: Bearer XXXXX' \ --header 'Content-Type: application/json' \ --data '{ "message": "On 6-month suspension"}'

 

this should be user id:<user_id>

Authorization: Bearer XXXXX .

XXXXX = APi key 

I am able to disable user using below rest API.

 

https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-lifecycle-disable-post

 

you need to generate API @https://admin.atlassian.com/ -> settings

In order to manage user users, you have to verify your domain.

let's say your users contain email =  user@test.com,  you need to verify the test.com domain.

 

domain verification steps:
https://admin.atlassian.com/ -> directory->domains

you can disable /delete user from https://admin.atlassian.com/ ->directory->usermanagement

 

sample request

curl --request POST \ --url 'https://api.atlassian.com/users/<user_id>/manage/lifecycle/disable' \ --header 'Authorization: Bearer XXXXX' \ --header 'Content-Type: application/json' \ --data '{ "message""On 6-month suspension"}'

 

this should be user id:<user_id>

Authorization: Bearer XXXXX .

XXXXX = APi key 

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you