Closed glmourad closed 2 years ago
@glmourad Hi, if I understand you correctly, you got an error after the following steps:
(Python 3.8.12)
>>> import okta_jwt_verifier
>>> okta_jwt_verifier.__version__
'0.2.3'
>>> issuer = 'https://test_issuer.com'
>>> audience = 'test_audience'
>>> okta_jwt_verifier.AccessTokenVerifier(issuer=issuer, audience=audience)
<okta_jwt_verifier.jwt_verifier.AccessTokenVerifier object at 0x10a081340>
>>>
In this case, I can't reproduce the error and don't see the reason which may cause this error. Could you please, provide more details? i.e. python version, code sample, etc.
Sorry,
Actually I have updated the version from 0.2.1 to 0.2.3 and now the last line of this function is throwing the error:
async def is_access_token_valid(issuer, audience, access_token): access_token_verifier = AccessTokenVerifier( issuer=issuer, audience=audience) await access_token_verifier.verify(access_token) return access_token_verifier.parse_token(access_token)
Yes, that's fine. We have deprecated JWTVerifier and refactored our codebase a bit. Now, AccessTokenVerifier
and IDTokenVerifier
can be used only for verifying relevant token, i.e. they have only one method - verify
. To parse token manually, you should use JWTUtils
class or the main class which contains all needed functionality - BaseJWTVerifier
.
I guess, we'll update our README to make it more clear.
Thanks. I'm using JWTUtils now.
@glmourad Thank you for letting us know it works. I'm closing this issue as resolved. Feel free to reopen this issue or create a new one if your problem exists still. Thanks for using OKTA!
Hi,
I'm getting the following error when invoking AccessTokenVerifier(issuer=issuer, audience=audience), @okta-jwt-verifier==0.2.3: 'AccessTokenVerifier' object has no attribute 'parse_token'
Thanks