Conversation
|
|
||
| # RFC9068: authorization servers and resource servers must support RS256 | ||
| if alg_values is None: | ||
| alg_values = ["RS256"] |
There was a problem hiding this comment.
The alg value should be in the JWT header, so I am not sure this is needed to guess here.
You should be able to achieve the same thing with:
from authlib.jose import jwt
jwt.decode(token, jwks)
There was a problem hiding this comment.
I apologize if my understanding of JWT and Access Tokens is a little sparse, but is there no concern with accepting any algorithm in the header? I did some looking around and this article suggests that you shouldn't necessarily trust the header, but unsure how accurate it is:
When verifying or decrypting the token you should always check the value of this claim with a list of algorithms that your system accepts. This mitigates an attack vector where someone would tamper with the token and make you use a different, probably less secure algorithm to verify the signature or decrypt the token.
I'm fine with removing the line and assuming the header alg is safe to use however if that's what we want to do.
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Resolves #764
Notes: