-
Notifications
You must be signed in to change notification settings - Fork 652
Conversation
@cancan101 this is good, thanks! Could you update any docs with this new setting? Also, might be a good idea to include a simple test since this is adding a new "feature". |
How do I run tests locally? This
|
@cancan101 that's strange, still running into issues running tests? |
This command still has the same error: |
@cancan101 hmm weird, works fine here. I'll look into what might be going on. The only things I think is missing is the test case for this, everything else looks fine. |
Suggestion where to put the test? https://github.com/GetBlimp/django-rest-framework-jwt/blob/master/tests/test_utils.py seems like the right place. How do I test changing the settings? |
Yeah that seems right. There's an example here.. |
Tests uploaded. |
### JWT_ISSUER | ||
This is a string that will be checked against the `iss` field of the token. | ||
|
||
Default is `None`(do not check `iss` on JWT). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(do not check
iss
on JWT)
Do you mean that if JWT_ISSUER
is None
and iss
is present on the JWT it won't be checked? This bit could be a little more clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just trying to interpret this code which checks the iss on the token only if issuer
is not None:
if issuer is not None:
if payload.get('iss') != issuer:
raise InvalidIssuerError('Invalid issuer')
Allow setting audience and issuer
@cancan101 thanks! |
Right now there is no way to pass in the audience to validate which causes the following to fail:
https://github.com/jpadilla/pyjwt/blob/5f9bc05803508b844d3fd9c61cd5210af06eecd8/jwt/api.py#L169
closes #79
closes #81