Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_jwt_config(self): # pragma: no cover
"""Get the JWT configuration for OpenIDImplicitGrant. The JWT
configuration will be used to generate ``id_token``. Developers
MUST implement this method in subclass, e.g.::
def get_jwt_config(self):
return {
'key': read_private_key_file(key_path),
'alg': 'RS512',
'iss': 'issuer-identity',
'exp': 3600
}
:return: dict
"""
deprecate('Missing "OpenIDImplicitGrant.get_jwt_config"', '1.0', 'fjPsV', 'oi')
config = self.server.config
key = config['jwt_key']
alg = config['jwt_alg']
iss = config['jwt_iss']
exp = config['jwt_exp']
return dict(key=key, alg=alg, iss=iss, exp=exp)
"""Provide user information for the given scope. Developers
MUST implement this method in subclass, e.g.::
from authlib.oidc.core import UserInfo
def generate_user_info(self, user, scope):
user_info = UserInfo(sub=user.id, name=user.name)
if 'email' in scope:
user_info['email'] = user.email
return user_info
:param user: user instance
:param scope: scope of the token
:return: ``authlib.oidc.core.UserInfo`` instance
"""
deprecate('Missing "OpenIDCode.generate_user_info"', '1.0', 'fjPsV', 'oi')
scopes = scope_to_list(scope)
return _generate_user_info(user, scopes)
from authlib.deprecate import deprecate
deprecate('Please use `authlib.integrations.httpx_client` instead.')
"""Provide user information for the given scope. Developers
MUST implement this method in subclass, e.g.::
from authlib.oidc.core import UserInfo
def generate_user_info(self, user, scope):
user_info = UserInfo(sub=user.id, name=user.name)
if 'email' in scope:
user_info['email'] = user.email
return user_info
:param user: user instance
:param scope: scope of the token
:return: ``authlib.oidc.core.UserInfo`` instance
"""
deprecate('Missing "OpenIDImplicitGrant.generate_user_info"', '1.0', 'fjPsV', 'oi')
scopes = scope_to_list(scope)
return _generate_user_info(user, scopes)
# flake8: noqa
from authlib.deprecate import deprecate
from authlib.integrations.flask_oauth2 import (
AuthorizationServer,
ResourceProtector,
current_token,
client_authenticated,
token_authenticated,
token_revoked,
)
from .cache import register_cache_authorization_code
deprecate('Deprecate "authlib.flask.oauth2", USE "authlib.integrations.flask_oauth2" instead.', '1.0', 'Jeclj', 'rn')
# flake8: noqa
from authlib.deprecate import deprecate
from authlib.integrations.django_client import OAuth, RemoteApp
deprecate('Deprecate "authlib.django.client", USE "authlib.integrations.django_client" instead.', '1.0', 'Jeclj', 'rn')
# flake8: noqa
from authlib.deprecate import deprecate
from authlib.integrations.requests_client import (
OAuth1Session, OAuth1Auth,
OAuth2Session, OAuth2Auth,
AssertionSession,
)
from .oauth_client import OAuthClient, OAUTH_CLIENT_PARAMS
from .errors import *
deprecate('Deprecate "authlib.client", USE "authlib.integrations.requests_client" instead.', '1.0', 'Jeclj', 'rn')