Coder Social home page Coder Social logo

Comments (7)

bretterer avatar bretterer commented on July 22, 2024

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.

techjutsu-mikeb avatar techjutsu-mikeb commented on July 22, 2024

That would be great if there was "official" support added for that.

from okta-sdk-python.

serhiibuniak-okta avatar serhiibuniak-okta commented on July 22, 2024

@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.

techjutsu-mikeb avatar techjutsu-mikeb commented on July 22, 2024

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.

serhiibuniak-okta avatar serhiibuniak-okta commented on July 22, 2024

@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.

techjutsu-mikeb avatar techjutsu-mikeb commented on July 22, 2024

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.

serhiibuniak-okta avatar serhiibuniak-okta commented on July 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.