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

Adds ability to injects additional headers to token end points. #503

Conversation

shankarphadatare2
Copy link

@shankarphadatare2 shankarphadatare2 commented Sep 2, 2021

Changes

Adds ability to injects additional headers to token end points and also add existing headers to newly created URLSession instance.

References

Please include relevant links supporting this change such as a:

Please note any links that are not publicly accessible.

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

…so add existing headers to newly created URLSession instance.
@shankarphadatare2 shankarphadatare2 requested a review from a team as a code owner September 2, 2021 14:36
@Widcket
Copy link
Contributor

Widcket commented Sep 2, 2021

Hi @shankarphadatare2, thanks for raising this.

The changes to pass custom headers to the renew method of the Authentication API client are not necessary. The API clients allow passing a custom URL session: https://github.com/auth0/Auth0.swift/blob/master/Auth0/Auth0.swift#L38

For that same reason, the changes to Credentials Manager are no necessary either, since the Credentials Manager accepts an Authentication API client instance via the initializer: https://github.com/auth0/Auth0.swift/blob/master/Auth0/CredentialsManager.swift#L46

So, the only thing that is needed is to add a way to pass a custom URL session when doing web auth. Like, a session property in the initializer, that is analogous to the Authentication API client: https://github.com/auth0/Auth0.swift/blob/master/Auth0/WebAuthenticatable.swift

If you want to implement that, we'll accept it as long as it has sufficient tests. But we cannot accept this PR as-is.

@shankarphadatare2
Copy link
Author

Hi @Widcket, Yeah i agree with you, Can you implement to pass custom URLSession when doing web auth? this way we can pass our URLsession with headers.
Thanks,
Shankar

@Widcket
Copy link
Contributor

Widcket commented Sep 2, 2021

@shankarphadatare2 we don't plan on doing this before the new major, so if you'd prefer to have it sooner we'll be happy to accept a PR as described.

@shankarphadatare2
Copy link
Author

@Widcket i prefer to have it sooner so we can just switch to your repo release version.

@Widcket
Copy link
Contributor

Widcket commented Sep 2, 2021

I'll be closing this PR then, since the changes for the described implementation are completely different.

@Widcket Widcket closed this Sep 2, 2021
@shankarphadatare2
Copy link
Author

@Widcket just want to check, Is this enhancement implemented and released?

@Widcket
Copy link
Contributor

Widcket commented Nov 11, 2021

Hi @shankarphadatare2, we're currently working on a new major version of the library, and we'll be adding a way to add custom headers.

@Widcket
Copy link
Contributor

Widcket commented Jan 17, 2022

@shankarphadatare2 Auth0.swift 2.0.0-beta.0 is out now, and it includes the ability to specify custom headers. See #637 for more information.

@Widcket
Copy link
Contributor

Widcket commented Mar 14, 2022

The 2.0.0 release is out now. Please check the Migration Guide for more information on how to update your apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants