Comments (7)
Hi @techjutsu-mikeb, thanks for the report here. This is a good idea here. I am going to address this with our engineer for python to see what we may be able to do for this. If you are considering a fork and PR, we would be open to taking a look as well. Just be aware, the SDK is generated through openAPI, so you would need to make sure you update the templates where necessary and re-generate the SDK code.
from okta-sdk-python.
That would be great if there was "official" support added for that.
from okta-sdk-python.
@techjutsu-mikeb Let me dig into it.
Meanwhile, if it's a blocker, you can write/use your own RequestExecutor (as per https://github.com/okta/okta-sdk-python#extending-the-client or https://github.com/okta/okta-sdk-python#extending-or-creating-new-classes).
We need to have something like:
request.add_header('header_name', 'header_value')
Is it correct?
I will notify when "official" support is ready.
from okta-sdk-python.
Thanks for the response @serhiibuniak-okta - I have no problem with the custom RequestExecutor. I need to provide the header and value only for specific API requests. I may need to use the raw API method prior to this going in.
Unless you can suggest other options?
Thank-you
from okta-sdk-python.
@techjutsu-mikeb I'm working on solution, which will work like the following:
import asyncio
from okta.client import Client as OktaClient
async def main():
client = OktaClient()
# set custom headers
client.set_custom_headers({'Custom-Header': 'custom value'})
# perform different requests with custom headers
users, resp, err = await client.list_users()
for user in users:
print(user.profile.first_name, user.profile.last_name)
# clear all custom headers
client.clear_custom_headers()
# output should be: {}
print(client.get_custom_headers())
asyncio.run(main())
from okta-sdk-python.
That looks great! Thanks. I'll be able to add custom headers per request/method execution which is what is supported by the factors verify API endpoint.
Thank-you @serhiibuniak-okta
from okta-sdk-python.
@techjutsu-mikeb SDK release 1.3.0 is ready. I'm closing this issue as resolved. Feel free to open a new one in case of any errors or suggestions.
from okta-sdk-python.
Related Issues (20)
- Partial Update of Attribute Statement values using SDK HOT 2
- Getting okta models has no attribute AutoLoginApplication
- Add support for managing Group Owners HOT 1
- Okta HTTP 500 E0000009 Internal Server Error when creating MultifactorEnrollmentPolicy HOT 1
- Response Headers not updated after next request HOT 2
- Listing factors fails if a `signed_nonce` factor is encountered HOT 8
- This SDK would let me retrieve/list all the users assigned to each application for every app in OKTA? HOT 5
- Can the README be made clearer that there are no plans to update this library to the next SDK version? HOT 2
- Access token expiry not handled when using OAuth 2.0 HOT 4
- Allow latest aenum release
- Exception raised when making an OAuth 2.0 API request without necessary scopes is unhelpful
- 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
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.