accounts.controllers.authentication module¶
Controllers for arXiv accounts application.
When a user logs in via the accounts service, they are issued a session key that is stored as a cookie in their browser. That session ID is registered in the distributed keystore, along with claims about the user’s identity and privileges in the system (based on their role). In subsequent requests handled by the UI ingress, the authenticator service uses that session key to validate the authenticated session, and to retrieve corresponding identity and authorization information.
-
class
accounts.controllers.authentication.
LoginForm
(formdata=None, obj=None, prefix='', data=None, meta=None, **kwargs)[source]¶ Bases:
wtforms.form.Form
Log in form.
-
password
= <UnboundField(PasswordField, ('Password',), {'validators': [<wtforms.validators.DataRequired object>]})>¶
-
username
= <UnboundField(StringField, ('Username or e-mail',), {'validators': [<wtforms.validators.DataRequired object>]})>¶
-
-
accounts.controllers.authentication.
login
(method, form_data, ip, next_page, track='')[source]¶ Provide the login form.
Parameters: Returns: - dict – Additional data to add to the response.
- int – Status code. This should be 303 (See Other) if all goes well.
- dict – Headers to add to the response.
Return type:
-
accounts.controllers.authentication.
logout
(session_cookie, classic_session_cookie, next_page)[source]¶ Log the user out, and redirect to arXiv.org.
Parameters: Returns: - dict – Additional data to add to the response.
- int – Status code. This should be 303 (See Other).
- dict – Headers to add to the response.
Return type: