openedx.core.djangoapps.user_authn.api package#

Submodules#

openedx.core.djangoapps.user_authn.api.constants module#

User Authentication API constants

openedx.core.djangoapps.user_authn.api.form_fields module#

Field Descriptions

openedx.core.djangoapps.user_authn.api.form_fields.add_city_field(is_field_required=False)#

Returns a city field description

openedx.core.djangoapps.user_authn.api.form_fields.add_company_field(is_field_required=False)#

Returns the company field descriptions

openedx.core.djangoapps.user_authn.api.form_fields.add_confirm_email_field(is_field_required=False)#

Returns a email confirmation field description

openedx.core.djangoapps.user_authn.api.form_fields.add_country_field(is_field_required=False)#

Returns country field description. This field is configurable on frontend, we just need to send the field name and whether or not we want to show error message if this field is empty

openedx.core.djangoapps.user_authn.api.form_fields.add_extension_form_field(field_name, custom_form, field_description, field_type)#

Returns Extension form field values

openedx.core.djangoapps.user_authn.api.form_fields.add_first_name_field(is_field_required=False)#

Returns the first name field description

openedx.core.djangoapps.user_authn.api.form_fields.add_gender_field(is_field_required=False)#

Returns the gender field description

openedx.core.djangoapps.user_authn.api.form_fields.add_goals_field(is_field_required=False)#

Returns the goals field description

openedx.core.djangoapps.user_authn.api.form_fields.add_honor_code_field(is_field_required=False)#

Returns a honor code field description and this field will be displayed directly on AuthnMFE

openedx.core.djangoapps.user_authn.api.form_fields.add_job_title_field(is_field_required=False)#

Returns the title field description

openedx.core.djangoapps.user_authn.api.form_fields.add_last_name_field(is_field_required=False)#

Returns the last name field description

openedx.core.djangoapps.user_authn.api.form_fields.add_level_of_education_field(is_field_required=False)#

Returns the level of education field description

openedx.core.djangoapps.user_authn.api.form_fields.add_mailing_address_field(is_field_required=False)#

Returns the mailing address field description

openedx.core.djangoapps.user_authn.api.form_fields.add_profession_field(is_field_required=False)#

Returns the profession field description

openedx.core.djangoapps.user_authn.api.form_fields.add_specialty_field(is_field_required=False)#

Returns the user specialty field description

openedx.core.djangoapps.user_authn.api.form_fields.add_state_field(is_field_required=False)#

Returns a State/Province/Region field description

openedx.core.djangoapps.user_authn.api.form_fields.add_terms_of_service_field(is_field_required=False)#

Returns terms of condition field description

openedx.core.djangoapps.user_authn.api.form_fields.add_title_field(is_field_required=False)#

Returns the title field description

openedx.core.djangoapps.user_authn.api.form_fields.add_work_experience_field(is_field_required=False)#

Returns the user work experience field description

openedx.core.djangoapps.user_authn.api.form_fields.add_year_of_birth_field(is_field_required=False)#

Returns the year of birth field description

openedx.core.djangoapps.user_authn.api.helper module#

Registration Fields View used by optional and required fields view.

class openedx.core.djangoapps.user_authn.api.helper.RegistrationFieldsContext(field_type='required')#

Bases: APIView

Registration Fields View used by optional and required fields view.

EXTRA_FIELDS = ['confirm_email', 'first_name', 'last_name', 'city', 'state', 'country', 'gender', 'year_of_birth', 'level_of_education', 'company', 'job_title', 'title', 'mailing_address', 'goals', 'honor_code', 'terms_of_service', 'profession', 'specialty', 'marketing_emails_opt_in']#
get_fields()#

Returns the required or optional fields configured in REGISTRATION_EXTRA_FIELDS settings.

user_profile_fields = ['language_proficiencies', 'social_links', 'id', 'user', 'name', 'meta', 'courseware', 'language', 'location', 'year_of_birth', 'gender', 'level_of_education', 'mailing_address', 'city', 'country', 'state', 'goals', 'bio', 'profile_image_uploaded_at', 'phone_number']#

openedx.core.djangoapps.user_authn.api.urls module#

Authn API urls

openedx.core.djangoapps.user_authn.api.views module#

Authn API Views

class openedx.core.djangoapps.user_authn.api.views.MFEContextThrottle#

Bases: AnonRateThrottle

Setting rate limit for MFEContextView API

rate = '20/m'#
class openedx.core.djangoapps.user_authn.api.views.MFEContextView(**kwargs)#

Bases: APIView

API to get third party auth providers, optional fields, required fields, user country code and the currently running pipeline.

get(request, **kwargs)#

Returns - dynamic registration fields - dynamic optional fields - the context for third party auth providers - user country code - the currently running pipeline.

Parameters:
  • request (HttpRequest) – The request, used to determine if a pipeline is currently running.

  • kwargs (dict) –

    tpa_hint (string): An override flag that will return a matching provider

    as long as its configuration has been enabled

    is_register_page (bool): Determine the call is from register or login page is_welcome_page (bool): Checks if the call is from the Welcome Page

throttle_classes = [<class 'openedx.core.djangoapps.user_authn.api.views.MFEContextThrottle'>]#
class openedx.core.djangoapps.user_authn.api.views.SendAccountActivationEmail(**kwargs)#

Bases: APIView

API to to send the account activation email using account activation cta.

authentication_classes = (<class 'edx_rest_framework_extensions.auth.session.authentication.SessionAuthenticationAllowInactiveUser'>,)#
permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
post(request, **kwargs)#

Returns status code. :param request: The request, used to get the user :type request: HttpRequest

Module contents#