Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: create_token() is hardcoded to post only production URL 'https://config.private.zscaler.com/signin' #174

Closed
rakbarkur opened this issue Feb 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rakbarkur
Copy link

rakbarkur commented Feb 14, 2023

Describe the bug

The def create_token() under class AuthenticatedSessionAPI in \pyzscaler\zpa\session.py returns a post statement that is hardcoded to
'https://config.private.zscaler.com/signin' today . This fails if we use non-prod (beta/override_url)

To Reproduce
Steps to reproduce the behavior:

If we use cloud='beta' while creating ZPA object, it fails during authentication because the session token is still pointing to prod URL.

def _get_zpa_obj():
# create a ZPA object
# this ZPA object stores the session token and simplifies access to API interfaces within ZPA
# use cloud= beta or cloud = production for respective enviroment
return ZPA(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET,
customer_id=CUSTOMER_ID,
cloud='beta')

Expected behavior

def create_token() should accept another argument that is dynamic based on environment chosen (prod/beta/override_url)

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Visual Studio

Additional context

Add any other context about the problem here.

@rakbarkur rakbarkur added the bug Something isn't working label Feb 14, 2023
@mitchos
Copy link
Owner

mitchos commented Feb 16, 2023

Thanks for raising @rakbarkur

This is a simple fix as you've highlighted, so I'll slot this one into the next release, I'm just finishing some work on #160 and #175 and then I'll release them all together.

@rakbarkur
Copy link
Author

Thank you @mitchos.

mitchos added a commit that referenced this issue Apr 3, 2023
refactor: move url_base instance attribute from private to public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants