Token verifier that uses an OAuthAuthorizationServerProvider. This is provided for backwards compatibility with existing auth_server_provider configurations. For new implementations using AS/RS separation, consider using the TokenVerifier protocol with a dedicated implementation like In
| 283 | |
| 284 | |
| 285 | class ProviderTokenVerifier(TokenVerifier): |
| 286 | """Token verifier that uses an OAuthAuthorizationServerProvider. |
| 287 | |
| 288 | This is provided for backwards compatibility with existing auth_server_provider |
| 289 | configurations. For new implementations using AS/RS separation, consider using |
| 290 | the TokenVerifier protocol with a dedicated implementation like IntrospectionTokenVerifier. |
| 291 | """ |
| 292 | |
| 293 | def __init__(self, provider: "OAuthAuthorizationServerProvider[AuthorizationCode, RefreshToken, AccessToken]"): |
| 294 | self.provider = provider |
| 295 | |
| 296 | async def verify_token(self, token: str) -> AccessToken | None: |
| 297 | """Verify token using the provider's load_access_token method.""" |
| 298 | return await self.provider.load_access_token(token) |
no outgoing calls