Quickstart#
This quickstart shows the fastest path to:
Import
pydplusInstantiate a
PyDPlusclientRetrieve a User ID using an email address
Disable the user within the RSA ID Plus tenant
For setup and environment requirements, see Overview and Installation.
1. Import The Package#
import pydplus
from pydplus import PyDPlus
print(pydplus.__version__)
2. Instantiate A Client#
OAuth is recommended for new integrations. You can keep credentials in a helper file so secrets stay out of your source code.
from pydplus import PyDPlus, constants as const
pydp = PyDPlus(
connection_type="oauth",
base_admin_url="https://example-company.access.securid.com",
oauth_client_id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
oauth_private_key="/path/to/oauth-private-key.jwk",
oauth_scope=[
const.OAUTH_SCOPES.USER_READ,
const.OAUTH_SCOPES.USER_MANAGE,
],
)
You can also use a helper file:
from pydplus import PyDPlus
pydp = PyDPlus(
helper="/path/to/helper.json",
)
Tip
Need help choosing the authentication pattern? See Authentication Guide, including OAuth scope presets and scope-strategy options.
3. Retrieve a User ID from an email address#
Use get_user_id() to retrieve the User ID for a given user:
user_id = pydp.users.get_user_id(email='john.doe@example.com')
print(f"User ID: {user_id}")
4. Disable a user#
Create a record with disable_user():
response = pydp.users.disable_user(user_id=user_id)
Where To Go Next#
Authentication details and helper-file formats: Authentication Guide
API errors, exceptions, and diagnostics: Error Handling Guide
Client and method reference: Client API Reference