Skip to content

Conversation

@yugangw-msft
Copy link

On Python 3.6, the jwt encode would return a byte array

@yugangw-msft yugangw-msft requested a review from rayluo January 15, 2019 03:57
TYPE_JWT = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
TYPE_SAML2 = "urn:ietf:params:oauth:client-assertion-type:saml2-bearer"
client_assertion_type = TYPE_JWT if "." in client_assertion else TYPE_SAML2
client_assertion_type = TYPE_JWT if "." in client_assertion.decode() else TYPE_SAML2
Copy link
Contributor

@rayluo rayluo Jan 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yugangw-msft Thanks for pointing this out! Now I'm actually thinking of do it in the other way around: ... if b"." in client_assertion else ..., due to some other reasons. If you don't mind, you also change it this way and give it a quick run in your local environment, and tell me the result.

Meanwhile I will probably organize such fix in a separate PR, because I'll have other places need same fix, as well as relevant docstrings etc.. And it is not fair to ask you to do all that in YOUR pr. :-) You already help us a lot by spotting this issue first.

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