Comments (8)
@gabrielsroka I will add this to our list to take a look at, however, until then, here is a working example for you to take a look at.
import asyncio
from okta.client import Client as OktaClient
async def main():
my_okta_client = OktaClient()
usr_list, resp, err = await my_okta_client.list_users()
print(err)
print(f"How many users in this list? {len(usr_list)}")
asyncio.run(main())
Internal Ref: OKTA-338626
from okta-sdk-python.
This example shows you not passing anything into your OktaClient
, so it relies on your ~/.okta/okta.yaml
file for information
from okta-sdk-python.
i'm using ENV variables, per the README.
i'm getting
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\okta\client.py", line 20, in <module>
from okta.config.config_setter import ConfigSetter
ModuleNotFoundError: No module named 'okta.config'
from okta-sdk-python.
i'm also getting
ModuleNotFoundError: No module named 'okta.client'
i tried it on 3 separate machines (Windows and Ubuntu). i tried uninstalling the old, beta okta package, too
from okta-sdk-python.
The error you were experiencing in this issue should be resolved with an install of okta through pip with version 1.0.1
from okta-sdk-python.
with version 1.0.1, this seems to work
from okta.client import Client as OktaClient
import asyncio
async def main():
client = OktaClient()
users, resp, err = await client.list_users()
print(len(users))
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
# asyncio.run(main()) # gives an error in Windows (but not in Ubuntu)
from okta-sdk-python.
here's a hello world for pagination. the example in the readme is confusing. it seems to be 3 different examples (which is fine, but could be made clearer). note that has_next()
is a function.
from okta.client import Client as OktaClient
import asyncio
async def main():
client = OktaClient()
users, resp, err = await client.list_users()
while True:
for user in users:
print(user.profile.login)
if resp.has_next():
users, err = await resp.next()
else:
break
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
from okta-sdk-python.
This will be resolved by #128
from okta-sdk-python.
Related Issues (20)
- Duplicate log lines when creating multiple client instances
- Reading OKTA Applications does not include configuredAttributeStatements HOT 1
- 💡 ℹ️ Update on the Python SDK Refresh ℹ️ 💡 HOT 4
- Users are missing when calling list_users() HOT 1
- [Feature Request] Device Assurance API Support
- Python 3.11 not supported? HOT 1
- error: client_assertion token has an expiration too far into the future HOT 1
- `forgot_password_generate_one_time_token` not-functional in private key mode HOT 1
- POST /token in body, not in url
- Potential data loss when saving app profile fields HOT 7
- UserFactorClient.list_factors always return null for "result" HOT 4
- [CVE-2024-23342] python-jose include by default python-ecdsa HOT 7
- Standardize configuration env vars with terraform provider
- The update_user method doesn't work reliably with string arrays
- Request Timeout cannot be set via an environment variable
- Pagination in get_logs not respecting until query parameter HOT 2
- okta/api_client.py — APIClient::form_response_body — AttributeError: 'str' object has no attribute 'items'
- vulnerability in indirect import of ecdsa library HOT 2
- Bug: "Okta direct auth API grants" are not valid OAuthGrantType HOT 3
- Missing headers throws 400 Bad request when call forgot_password_generate_one_time_token method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okta-sdk-python.