Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

identitystore describe-user: get enabled/disabled status #628

Closed
jk2l opened this issue Oct 24, 2023 · 3 comments
Closed

identitystore describe-user: get enabled/disabled status #628

jk2l opened this issue Oct 24, 2023 · 3 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@jk2l
Copy link

jk2l commented Oct 24, 2023

More or less follow up on #477, as that ticket is closed and AWS team may not see it. I am trying to start a new conversation here.

as AWS console's API provide the Active field information but not accessible via official AWS API. what is aws-sdk stand on integrate with that side of API by pulling in the information from that? there are example codes on how to achieve it, but it will be great to be built in officially into AWS sdk

@jk2l
Copy link
Author

jk2l commented Oct 24, 2023

Here is my example code on how to pull in that information

from botocore.auth import SigV4Auth
import requests
from botocore.awsrequest import AWSRequest
import botocore.session
import json

def fetch_all_users(identity_store_id, region):
    session = botocore.session.Session()
    sigv4 = SigV4Auth(session.get_credentials(), 'identitystore', region)
    endpoint = f'https://up.sso.{region}.amazonaws.com/identitystore/'
    data = json.dumps( {"IdentityStoreId":identity_store_id, "MaxResults":100 })
    headers = {
        'Content-Type': 'application/x-amz-json-1.1',
        'X-Amz-Target': 'AWSIdentityStoreService.SearchUsers'
    }
    request = AWSRequest(method='POST', url=endpoint, data=data, headers=headers)

    sigv4.add_auth(request)
    prepped = request.prepare()

    response = requests.post(prepped.url, headers=prepped.headers, data=data)
    return response

@tim-finnigan tim-finnigan self-assigned this Oct 30, 2023
@tim-finnigan
Copy link
Contributor

I provide an updated here on the issue you linked: #477 (comment). Going to close this one as a duplicate.

@tim-finnigan tim-finnigan added the duplicate This issue or pull request already exists label Oct 30, 2023
@github-actions
Copy link

This issue is now closed.

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants