openedx.core.djangoapps.user_authn package#
Subpackages#
- openedx.core.djangoapps.user_authn.api package
- Submodules
- openedx.core.djangoapps.user_authn.api.constants module
- openedx.core.djangoapps.user_authn.api.form_fields module
add_city_field()add_company_field()add_confirm_email_field()add_country_field()add_extension_form_field()add_first_name_field()add_gender_field()add_goals_field()add_honor_code_field()add_job_title_field()add_last_name_field()add_level_of_education_field()add_mailing_address_field()add_profession_field()add_specialty_field()add_state_field()add_terms_of_service_field()add_title_field()add_work_experience_field()add_year_of_birth_field()
- openedx.core.djangoapps.user_authn.api.helper module
- openedx.core.djangoapps.user_authn.api.urls module
- openedx.core.djangoapps.user_authn.api.views module
- Module contents
- openedx.core.djangoapps.user_authn.config package
- openedx.core.djangoapps.user_authn.views package
- Submodules
- openedx.core.djangoapps.user_authn.views.auth module
- openedx.core.djangoapps.user_authn.views.auto_auth module
- openedx.core.djangoapps.user_authn.views.login module
- openedx.core.djangoapps.user_authn.views.login_form module
- openedx.core.djangoapps.user_authn.views.logout module
- openedx.core.djangoapps.user_authn.views.password_reset module
LogistrationPasswordResetViewPasswordResetConfirmWrapperPasswordResetFormNoActivePasswordResetFormNoActive.base_fieldsPasswordResetFormNoActive.clean_email()PasswordResetFormNoActive.declared_fieldsPasswordResetFormNoActive.error_messagesPasswordResetFormNoActive.is_account_recoveryPasswordResetFormNoActive.mediaPasswordResetFormNoActive.save()PasswordResetFormNoActive.users_cache
PasswordResetThrottlePasswordResetTokenValidationPasswordResetViewResetTokenValidationThrottleget_password_reset_form()get_user_default_email_params()password_change_request_handler()password_reset()request_password_change()send_password_reset_email_for_user()send_password_reset_success_email()
- openedx.core.djangoapps.user_authn.views.register module
RegistrationValidationViewRegistrationValidationView.authentication_classesRegistrationValidationView.confirm_email_handler()RegistrationValidationView.country_handler()RegistrationValidationView.email_handler()RegistrationValidationView.name_handler()RegistrationValidationView.password_handler()RegistrationValidationView.post()RegistrationValidationView.username_handler()RegistrationValidationView.username_suggestionsRegistrationValidationView.validation_handlers
RegistrationViewcreate_account_with_params()is_new_user()
- openedx.core.djangoapps.user_authn.views.registration_form module
- openedx.core.djangoapps.user_authn.views.utils module
- Module contents
Submodules#
openedx.core.djangoapps.user_authn.apps module#
User Authentication Configuration
- class openedx.core.djangoapps.user_authn.apps.UserAuthnConfig(app_name, app_module)#
Bases:
AppConfigApplication Configuration for User Authentication.
- name = 'openedx.core.djangoapps.user_authn'#
- plugin_app = {'signals_config': {'lms.djangoapp': {'receivers': [{'receiver_func_name': 'user_fields_changed', 'signal_path': 'common.djangoapps.util.model_utils.USER_FIELDS_CHANGED'}]}}, 'url_config': {'lms.djangoapp': {'app_name': 'openedx.core.djangoapps.user_authn', 'namespace': '', 'regex': '', 'relative_path': 'urls'}}}#
openedx.core.djangoapps.user_authn.exceptions module#
User Authn related Exceptions.
- exception openedx.core.djangoapps.user_authn.exceptions.AuthFailedError(value=None, redirect=None, redirect_url=None, error_code=None, context={})#
Bases:
ExceptionThis is a helper for the login view, allowing the various sub-methods to error out with an appropriate failure message.
- get_response()#
Returns a dict representation of the error.
openedx.core.djangoapps.user_authn.message_types module#
ACE message types for user_authn-related emails.
- class openedx.core.djangoapps.user_authn.message_types.PasswordReset(*args, **kwargs)#
Bases:
BaseMessageTypeA message to the user with password reset link.
- class openedx.core.djangoapps.user_authn.message_types.PasswordResetSuccess(*args, **kwargs)#
Bases:
BaseMessageTypeA message to the user when the password rest was successful.
openedx.core.djangoapps.user_authn.serializers module#
MFE Context API Serializers
- class openedx.core.djangoapps.user_authn.serializers.ContextDataSerializer(*args, **kwargs)#
Bases:
SerializerContext Data Serializers
- get_pipelineUserDetails(obj)#
- class openedx.core.djangoapps.user_authn.serializers.MFEContextSerializer(*args, **kwargs)#
Bases:
SerializerSerializer class to convert the keys of MFE Context Response dict object to camelCase format.
- class openedx.core.djangoapps.user_authn.serializers.PipelineUserDetailsSerializer(*args, **kwargs)#
Bases:
SerializerPipeline User Details Serializers
- class openedx.core.djangoapps.user_authn.serializers.ProvidersSerializer(*args, **kwargs)#
Bases:
SerializerProviders Serializers
openedx.core.djangoapps.user_authn.signals module#
Signals for user_authn
- openedx.core.djangoapps.user_authn.signals.user_fields_changed(user=None, table=None, changed_fields: Dict[str, Tuple[Any, Any]] | None = None, **_kwargs)#
Update a collection of user profile fields in segment when they change in the database
- Parameters:
user – The user object for the user being changed
table – The name of the table being updated
changed_fields – A mapping from changed field name to old and new values.
openedx.core.djangoapps.user_authn.tasks module#
This file contains celery tasks for sending email
openedx.core.djangoapps.user_authn.toggles module#
Toggles for user_authn
- openedx.core.djangoapps.user_authn.toggles.is_auto_generated_username_enabled()#
Checks if auto-generated username should be enabled.
- openedx.core.djangoapps.user_authn.toggles.is_require_third_party_auth_enabled()#
- openedx.core.djangoapps.user_authn.toggles.should_redirect_to_authn_microfrontend()#
Checks if login/registration should be done via MFE.
openedx.core.djangoapps.user_authn.urls module#
URLs for User Authentication
openedx.core.djangoapps.user_authn.urls_common module#
Common URLs for User Authentication
Note: The split between urls.py and urls_common.py is hopefully temporary. For now, this is needed because of difference in CMS and LMS that have not yet been cleaned up.
This is also home to urls for endpoints that have been consolidated from other djangoapps, which leads to inconsistent prefixing.
openedx.core.djangoapps.user_authn.utils module#
Utility functions used during user authentication.
- openedx.core.djangoapps.user_authn.utils.check_pwned_password(password)#
Check the Pwned Databases for vulnerable passwords. check_pwned_password returns password hash suffix and a dictionary containing suffix of every SHA-1 password hash beginning with the specified prefix, followed by a count of how many times it appears in their data set.
- openedx.core.djangoapps.user_authn.utils.generate_username_suggestions(name: str) list[str]#
Generate 3 available username suggestions based on the provided name.
- Parameters:
name (str) – The full name to generate username suggestions from. Must contain only ASCII characters.
- Returns:
- A list of up to 3 available username suggestions,
or an empty list if name contains non-ASCII characters or if no valid suggestions could be generated.
- Return type:
list[str]
Note
Generated usernames will be combinations of: - firstname + lastname - first initial + lastname - firstname + random number
- openedx.core.djangoapps.user_authn.utils.is_registration_api_v1(request)#
Checks if registration api is v1 :param request: :return: Bool
- openedx.core.djangoapps.user_authn.utils.is_safe_login_or_logout_redirect(redirect_to, request_host, dot_client_id, require_https)#
Determine if the given redirect URL/path is safe for redirection.
- Parameters:
redirect_to (str) – The URL in question.
request_host (str) – Originating hostname of the request. This is always considered an acceptable redirect target.
dot_client_id (str|None) – ID of Django OAuth Toolkit client. It is acceptable to redirect to any of the DOT client’s redirect URIs. This argument is ignored if it is None.
require_https (str) – Whether HTTPs should be required in the redirect URL.
Returns: bool
- openedx.core.djangoapps.user_authn.utils.remove_special_characters_from_name(name: str) str#