Debian Codegraph @

CHANGES.rst

raw
1 Flask-Security Changelog
2 ========================
3
4 Here you can see the full list of changes between each Flask-Security release.
5
6 Version 5.8.2
7 -------------
8
9 Released August 11, 2026
10
11 Fixes
12 +++++
13 - (:pr:`1265`) Fix for GHSA-f66q-9rf6-8795 - WebAuthn reauthentication freshness bypass. (tonghuaroot)
14 - (:issue:`1263`) :py:data:`SECURITY_CACHE_CONTROL` directives were added to every
15 application response instead of just responses from Flask-Security endpoints
16 as documented. (Ceirced)
17 - (:issue:`1212`) Newly introduced :py:meth:`.UserMixin.is_locked` logic is inverted.
18 - (:issue:`1244`) Fix login form remember me checkbox.
19
20 Backwards Compatibility Concerns
21 +++++++++++++++++++++++++++++++++
22 - The fix for the inverted `is_locked` logic will require any application using it
23 to invert their logic.
24
25
26 Version 5.8.1
27 -------------
28
29 Released May 21, 2026
30
31 Fixes
32 +++++
33 - (:issue:`1222`) Fix for GHSA-w2j7-f3c6-g8cw - Possible open-redirect with ALLOW_SUBDOMAIN option.
34 - (:issue:`1215`) Fix for GHSA-97r5-pg8x-p63p - Possible oauth bypass in /verify
35
36
37 Version 5.8.0
38 -------------
39
40 Released April 15, 2026
41
42 Features & Improvements
43 +++++++++++++++++++++++
44 - (:pr:`1170`) Add API :py:meth:`.UserMixin.check_tf_required` to allow applications to control which users
45 require two-factor authentication.
46 - (:issue:`1178`) Add Cache-Control headers.
47 - (:issue:`1165`) Add support for using Social Login (OAuth) for verification.
48 - (:issue:`1188`) Add tracking of failed authentication attempts via :py:meth:`.UserMixin.track_failed_authn`
49 and signal :py:data:`user_failed_authn`
50 - (:issue:`1192`) Add API for application to decide if a particular user account is locked.
51
52 Fixes
53 +++++
54 - (:issue:`1179`) Fix verify_password for bcrypt 5.0 (mephi42)
55 - (:issue:`1200`) Fix username_recovery w.r.t. inactive and non-confirmed users
56 - (:issue:`1189`) Return additional fields for JSON responses with QR codes
57
58 Docs and Chores
59 +++++++++++++++
60 - (:pr:`1150`) Update de_DE translations (swaeberle)
61 - (:pr:`1151`) Update ca_ES translations (arielvb)
62 - (:pr:`1152`) Update es_ES translations (arielvb)
63 - (:pr:`1196`) Update arabic translations (samialfattani)
64 - (:pr:`1199`) Update it_IT translations (gissimo)
65 - (:pr:`1185`) Change external facing terminology from 'Social OAuth' to 'Social Login'.
66
67 Version 5.7.1
68 -------------
69
70 Released November 23, 2025
71
72 Fixes
73 +++++
74 - (:issue:`1147`) Regression when updating hash algorithm from bcrypt (willcroft)
75
76 Version 5.7.0
77 -------------
78
79 Released November 14, 2025
80
81 This release contains a set of small backward incompatible changes. Please read these notes carefully.
82
83 Features & Improvements
84 +++++++++++++++++++++++
85 - (:pr:`1132`) Add Arabic translations (samialfattani)
86 - (:issue:`1123`) Enable forgot-password workflow for authenticated users.
87
88 Fixes
89 +++++
90 - (:pr:`1115`) Fix broken link in docs and improve docstrings/typing for util classes.
91 - (:issue:`1127`) Add nonce to script tags if configured to support nonce-based Content-Security-Policy (ahanak).
92 - (:issue:`1133`) Remove unnecessary (optional) dependency on sqlalchemy_utils.
93 - (:pr:`1140`) Fix localization of tf_select choices.
94 - (:pr:`1143`) Support bcrypt 5.0 - See below for important compatibility concerns.
95 This also replaces passlib with libpass for all versions.
96
97 Docs and Chores
98 +++++++++++++++
99 - (:pr:`1144`) Update ES and IT translations (gissimo)
100 - (:pr:`1106`) Drop support for Python 3.9. This removes the dependency on importlib_resources,
101 updates pypy to 3.10, and uses 3.12 as base python for tests/tox.
102 - (:pr:`1112`) Flip :py:data:`SECURITY_USE_REGISTER_V2` default to ``True``.
103 - (:pr:`1117`) Flip default mail package back to Flask-Mail (from Flask-Mailman).
104 - (:issue:`1139`) Change external facing terminology from 'WebAuthn Credential' to 'passkey'.
105 - (:pr:`1142`) Setting of xx_util_cls from kwargs which was deprecated in 5.6.1 has been removed.
106 The BACKWARDS_COMPAT_UNAUTHN option (code) which has been deprecated since 5.4 has been removed.
107
108 Backwards Compatibility Concerns
109 +++++++++++++++++++++++++++++++++
110 - Flask-Security now depends on ``libpass`` (https://pypi.org/project/libpass/) for all versions. Be sure to UNINSTALL
111 passlib, ensure the passlib directory is empty and then install libpass - we have seen reports when both are installed -
112 it doesn't work!
113
114 In bcrypt 5.0 they started throwing a ValueError for passwords/secrets longer than 72 bytes. It is important to know that by default
115 Flask-Security performs a double hash - taking the secret, using HMAC(SHA512) then b64encodng the result. This means that ANY password
116 will be longer than 72 bytes (86 to be exact). In the past bcrypt would silently truncate the input - now we have to do that explicitly.
117 OWASP says truncation concerns are negligible: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#input-limits-of-bcrypt
118
119 - The default RegisterForm is now the new RegisterFormV2 - Please read :ref:`register_form_migration`.
120 Flask-Security will emit a DeprecationWarning if the :py:data:`SECURITY_USE_REGISTER_V2` is set to False.
121
122 - In 5.0 we changed the default mailer package to Flask-Mailman since Flask-Mail was no longer supported.
123 Flask-Mail is again supported and is part of Pallets-Eco. Both packages are still supported based on which one
124 an application initializes. The only backwards compatibility concern is that if you use the setup extras 'common',
125 it will install Flask-Mail rather than Flask-Mailman.
126
127 - In the optional dependencies 'fsqla' we removed sqlalchemy_utils - while many applications might want these useful
128 add-ons - they aren't required for standard SQLAlchemy use.
129
130 Version 5.6.2
131 -------------
132
133 Released May 4, 2025
134
135 Fixes
136 +++++
137 - (:issue:`1032` and :issue:`1096`) Use libpass for python >= 3.12
138 - (:pr:`1086`) Fix FR translation test for Change Password (nickcuenca)
139 - (:issue:`1090`) Properly document context variables available in email templates.
140 - (:issue:`1093`) Add confirmation link/token and reset link/token to welcome_existing email template.
141
142 Notes
143 +++++
144 Since Python 3.12 no longer contains setuptools - the old passlib failed to import.
145 Rather than require setuptools, for Python >=3.12 we now depend on the fork ``libpass`` (https://pypi.org/project/libpass/)
146 This is a very new package and rather than possibly cause backwards compat issues for projects
147 not using Python >=3.12 - Flask-Security maintains the dependency on passlib for Python <3.12.
148
149 Note: you can still use passlib for 3.12 and 3.13 - you have to manually add setuptools.
150
151 Version 5.6.1
152 -------------
153
154 Released March 18, 2025
155
156 Fixes
157 +++++
158 - (:issue:`1077`) Fix runtime modification of a config string (TWO_FACTOR_METHODS)
159 - (:issue:`1078`) Fix CLI user_create when model doesn't contain username
160 - (:issue:`1076`) xxx_util_cls instances should be public and documented.
161
162 Backwards Compatibility Concerns
163 +++++++++++++++++++++++++++++++++
164 As part of :issue:`1076` the following cleanup was done:
165
166 - The xxx_util_cls arguments are now stored in 'private' instance variables - they are never
167 used after Flask-Security initialization and have never been documented.
168 - The xxx_util_cls options should only be set as part of Flask-Security construction.
169 Setting them via init_app(kwargs) or app.config["SECURITY_XX"] has been deprecated.
170
171 Version 5.6.0
172 -------------
173
174 Released February 12, 2025
175
176 Features & Improvements
177 +++++++++++++++++++++++
178 - (:issue:`1038`) Add support for 'secret_key' rotation (jamesejr)
179 - (:issue:`980`) Add support for username recovery in simple login flows (jamesejr)
180 - (:issue:`1055`) Add support for changing username
181 - (:pr:`1048`) Add support for Python 3.13
182 - (:issue:`1043`) Unify Register forms (and split out re-type password option) Please read :ref:`register_form_migration`.
183
184 Fixes
185 +++++
186 - (:pr:`1062`) Fix duplicate HTML ids in templates.
187 - (:pr:`1067`) Fix more duplicate HTML ids in templates.
188 - (:issue:`1064`) Ensure templates pass W3C validation (see below)
189
190 Docs and Chores
191 +++++++++++++++
192 - (:pr:`1052`) Remove deprecated TWO_FACTOR configuration variables
193 - (:pr:`1069`) Update ES and IT translations (gissimo)
194 - (:pr:`1071`) Improve templates - two-factor is hyphenated, re-authenticate is not.
195 Also try to embed links into xlatable strings.
196
197 Notes
198 +++++
199 Python 3.13 removed ``crypt``, which passlib attempts to import and use as
200 part of its safe_crypt() method (fallback is to return None).
201 However - that method only appears to be called in a few crypt handlers and
202 for bcrypt - only for the built-in bcrypt - not if the bcrypt package is installed.
203 passlib is not maintained - a new fork (10/1/2024) (https://pypi.org/project/libpass/)
204 seems promising and has been tested with python 3.13 and Flask-Security. If that fork matures we will
205 change the dependencies appropriately.
206
207 The register forms have been combined - or more accurately - there is a new RegisterFormV2
208 that subsumes the features of both the old RegisterForm and ConfirmRegisterForm.
209 Please read :ref:`register_form_migration`.
210
211 The SECURITY_TWO_FACTOR_{SECRET, URI_SERVICE_NAME, SMS_SERVICE, SMS_SERVICE_CONFIG}
212 have been removed (they have been deprecated for a while). Use the equivalent
213 :py:data:`SECURITY_TOTP_SECRETS`, :py:data:`SECURITY_TOTP_ISSUER`, :py:data:`SECURITY_SMS_SERVICE` and
214 :py:data:`SECURITY_SMS_SERVICE_CONFIG`.
215
216 Backwards Compatibility Concerns
217 +++++++++++++++++++++++++++++++++
218 The fixes to all the templates to pass W3C validation could introduce some incompatibilities:
219
220 - All templates now have a default <title> - before, the <title> element was empty.
221 - The HTML id of the rescue form submit button was changed to 'rescue'
222 - The HTML id of the webauthn delete form name field was changed to 'delete-name'
223 - Some template headings were changed to improve consistency
224 - The csrf_token HTML id was changed on us_setup.html, wan_register.html, two_factor_setup.html
225 two_factor_verify_code.html, us_verify.html, verify.html for the second form on the page.
226 - On us_setup.html and two_factor_setup.html the submit code button HTML id was changed.
227
228 Version 5.5.2
229 -------------
230
231 Released August 5, 2024
232
233 More attempts to upload to pypi both flask-security and flask-security-too.
234 No code changes - however the build manifest changed so the source distribution
235 contents might be slightly different.
236
237 Docs and Chores
238 +++++++++++++++
239 - (:pr:`1019`) Separate publish workflows for each pypi package
240
241 Version 5.5.1
242 -------------
243
244 Released August 1, 2024
245
246 I am pleased to announce that Flask-Security-Too is now part of pallets-eco and has returned
247 to be released as 'Flask-Security'. For the foreseeable future, we will publish the same release to both
248 Flask-Security and Flask-Security-Too on PyPI.
249
250 There are no code changes.
251
252 Docs and Chores
253 +++++++++++++++
254 - (:pr:`1015`) Convert docs, links, badges, etc to pallets-eco
255
256 Version 5.5.0
257 -------------
258
259 Released July 24, 2024
260
261 Features & Improvements
262 +++++++++++++++++++++++
263 - (:issue:`956`) Add support for changing registered user's email (:py:data:`SECURITY_CHANGE_EMAIL`).
264 - (:issue:`944`) Change default password hash to argon2 (was bcrypt). See below for details.
265 - (:pr:`990`) Add freshness capability to auth tokens (enables /us-setup to function w/ just auth tokens).
266 - (:pr:`991`) Add support to /tf-setup to not require sessions (use a state token).
267 - (:issue:`994`) Add support for Flask-SQLAlchemy-Lite - including new all-inclusive models
268 that conform to sqlalchemy latest best-practice (type-annotated).
269 - (:pr:`1007`) Convert other sqlalchemy-based datastores from legacy 'model.query' to best-practice 'select'
270 - (:issue:`983`) Allow applications more flexibility defining allowable redirects.
271
272 Fixes
273 +++++
274 - (:pr:`972`) Set :py:data:`SECURITY_CSRF_COOKIE` at beginning (GET /login) of authentication
275 ritual - just as we return the CSRF token. (thanks @e-goto)
276 - (:issue:`973`) login and unified sign in should handle GET for authenticated user consistently.
277 - (:pr:`995`) Don't show sms options if not defined in US_ENABLED_METHODS. (fredipevcin)
278 - (:pr:`1009`) Change :py:data:`SECURITY_DEPRECATED_HASHING_SCHEMES` to ``["auto"]``.
279
280 Docs and Chores
281 +++++++++++++++
282 - (:pr:`979`) Update Russian translations (ademaro)
283 - (:pr:`1004`) Update ES and IT translations (gissimo)
284 - (:pr:`981` and :pr:`977`) Improve docs
285 - (:pr:`992`) The long deprecated `get_token_status` is no longer exported
286 - (:pr:`992`) Drop Python 3.8 support.
287 - (:issue:`1001`) Try a different approach to typing User and Role models.
288
289 Backwards Compatibility Concerns
290 +++++++++++++++++++++++++++++++++
291 - Notes around the change to argon2 as the default password hash:
292 - applications should add the argon2_cffi package to their requirements (it is included in the flask_security[common] extras).
293 - leave bcrypt installed so that old passwords still work.
294 - the default configuration will re-hash passwords with argon2 upon first use.
295 - Changes to /tf-setup
296 The old path - using state set in the session still works as before. The new path is
297 just for the case an authenticated user wants to change their 2FA setup.
298 - Changes to sqlalchemy-based datastores
299 Flask-Security no longer uses the legacy model.query - all DB access is done via
300 `select(xx).where(xx)`. As a result the find_user() method now only takes a SINGLE
301 column:value from its kwargs - in prior releases all kwargs were passed into the query.filter.
302
303 Version 5.4.3
304 -------------
305
306 Released March 23, 2024
307
308 Fixes
309 +++++
310 - (:issue:`950`) Regression - some templates no longer getting correct config (thanks pete7863).
311 - (:issue:`954`) CSRF not properly ignored for application forms using :py:data:`SECURITY_CSRF_PROTECT_MECHANISMS`.
312 - (:pr:`957`) Improve jp translations (e-goto)
313 - (:issue:`959`) Regression - datetime_factory should still be an attribute (thanks TimotheeJeannin)
314 - (:issue:`942`) :py:data:`SECURITY_RETURN_GENERIC_RESPONSES` hid email validation/syntax errors.
315
316 Version 5.4.2
317 -------------
318
319 Released March 8, 2024
320
321 Fixes
322 +++++
323 - (:issue:`946`) OpenAPI spec missing.
324 - (:pr:`945`) Doc fixes (e-goto)
325 - (:pr:`941`) Update ES/IT translations (gissimo)
326
327 Version 5.4.0 & 5.4.1
328 ----------------------
329
330 Released February 26, 2024
331
332 Among other changes, this continues the process of dis-entangling Flask-Security
333 from Flask-Login and may require some application changes due to backwards incompatible changes.
334
335 Features & Improvements
336 +++++++++++++++++++++++
337 - (:issue:`879`) Work with Flask[async]. view decorators and signals support async handlers.
338 - (:pr:`900`) CI support for python 3.12
339 - (:pr:`901`) Work with py_webauthn 2.0 (and only 2.0+)
340 - (:pr:`899`) Improve (and simplify) Two-Factor setup. See below for backwards compatability issues and new functionality.
341 - (:issue:`912`) Improve oauth debugging support. Handle next propagation in a more general way.
342 - (:pr:`877`) Make AnonymousUser (Flask-Login) optional and deprecated.
343 - (:pr:`906`) Remove undocumented and untested looking in session for possible 'next'
344 redirect location.
345 - (:pr:`881`) No longer rely on Flask-Login.unauthorized callback. See below for implications.
346 - (:issue:`904`) Changes to default unauthorized handler - remove use of referrer header (see below) and document precise behavior.
347 - (:pr:`927`) The authentication_token format has changed - adding per-token expiry time and future session ID.
348 Old tokens are still accepted.
349
350
351 Docs and Chores
352 +++++++++++++++
353 - (:pr:`889`) Improve method translations for unified signin and two factor. Remove support for Flask-Babelex.
354 - (:pr:`911`) Chore - stop setting all config as attributes. init_app(\*\*kwargs) can only
355 set forms, flags, and utility classes (see below for compatibility concerns).
356 - (:pr:`873`) Update Spanish and Italian translations. (gissimo)
357 - (:pr:`855`) Improve translations for two-factor method selection. (gissimo)
358 - (:pr:`866`) Improve German translations. (sr-verde)
359 - (:pr:`911`) Remove deprecation of AUTO_LOGIN_AFTER_CONFIRM - it has a reasonable use case.
360 - (:pr:`931`) Update message extraction - note that the CONFIRM_REGISTRATION message was changed to improve
361 readability.
362
363 Fixes
364 +++++
365
366 - (:issue:`845`) us-signin magic link should use fs_uniquifier (not email).
367 - (:issue:`893`) Improve open-redirect vulnerability mitigation. (see below)
368 - (:issue:`875`) user_datastore.create_user has side effects on mutable inputs. (NoRePercussions)
369 - (:pr:`878`) The long deprecated _unauthorized_callback/handler has been removed.
370 - (:issue:`884`) Oauth re-used POST_LOGIN_VIEW which caused confusion. See below for the new configuration and implications.
371 - (:pr:`908`) Improve CSRF documentation and testing. Fix bug where a CSRF failure could
372 return an HTML page even if the request was JSON.
373 - (:issue:`925`) Register with JSON and authentication token failed CSRF. (lilz-egoto)
374 - (:issue:`870`) Fix 2 issues with CSRF configuration.
375 - (:pr:`914`) It was possible that if :data:`SECURITY_EMAIL_VALIDATOR_ARGS` were set that
376 deliverability would be checked even for login.
377
378 Backwards Compatibility Concerns
379 +++++++++++++++++++++++++++++++++
380
381 - Passing in an AnonymousUser class as part of Security initialization has been removed.
382 - The never-public method _get_unauthorized_response has been removed.
383 - Social-Oauth - a new configuration variable :py:data:`SECURITY_POST_OAUTH_LOGIN_VIEW` was introduced
384 and it replaces :py:data:`SECURITY_POST_LOGIN_VIEW` in the oauthresponse logic when
385 :py:data:`SECURITY_REDIRECT_BEHAVIOR` == `"spa"`.
386 - Two-Factor setup. Prior to this release when setting up "SMS" the `/tf-setup` endpoint could
387 be POSTed to w/o a phone number, and then another POST could be made to set the phone number.
388 This has always been confusing and added complexity to the code. Now, if "SMS" is selected, the phone number
389 must be supplied (which has always been supported).
390 Other changes:
391
392 - The default two-factor-setup.html template now has a more generic `"Enter code to complete setup"` message.
393 - Make sure the `"disable"` option first.
394 - Adding any currently configured two-factor method on setup failure.
395 - The two_factor_verify template won't show the rescue form if it isn't set.
396 - A GET on /tf-validate now returns the two-factor-validate-form always - before
397 if the client was validating a new method, it would return the two-factor-setup-form
398 - After successfully disabling two-factor the client is redirected to :py:data:`SECURITY_TWO_FACTOR_POST_SETUP_VIEW`
399 rather than :py:data:`SECURITY_POST_LOGIN_VIEW`.
400
401 - Bring unauthenticated handling completely into Flask-Security:
402 Prior to this release, Flask-Security's :meth:`.Security.unauthn_handler` - called when
403 a request wasn't properly authenticated - handled JSON requests then delegated
404 form responses to Flask-Login's unauthenticated_callback. That logic has been moved
405 into Flask-Security and Flask-Login is configured to call back into Flask-Security's
406 handler. While the logic is very similar the following differences might be observed:
407
408 - Flask-Login's FORCE_HOST_FOR_REDIRECTS configuration isn't honored
409 - Flask-Login's USE_SESSION_FOR_NEXT configuration isn't honored
410 - The flashed message is SECURITY_MSG_UNAUTHENTICATED rather than SECURITY_MSG_LOGIN.
411 Furthermore, SECURITY_MSG_UNAUTHENTICATED was reworded to read better.
412 - Flask-Login uses `urlencode` to encode the `next` query param - which quotes the '/' character.
413 Werkzeug (which Flask-Security uses to build the URL) uses `quote`
414 which considers '/' a safe character and isn't encoded.
415 - The signal sent on an unauthenticated request has changed to :data:`user_unauthenticated`.
416 Flask-Login used to send a `user_unauthorized` signal.
417
418 - Flask-Security no longer configures anything related to Flask-Login's `fresh_login` logic.
419 This shouldn't be used - instead use Flask-Security's :meth:`flask_security.auth_required` decorator.
420 - Support for Flask-Babelex has been removed. Please convert to Flask-Babel.
421 - JSON error response has changed due to issue with WTForms form-level errors. When WTForms
422 introduced form-level errors they added it to the form.errors response using `None` as a key.
423 When serializing it, it would turn into "null". However, if there is more than one error
424 the default settings for JSON serialization in Flask attempt to sort the keys - which fails
425 with the `None` key. An issue has been filed with WTForms - and maybe it will be changed.
426 Flask-Security now changes any `None` key to `""`.
427 - The default unauthorized handler behavior has changed slightly and is now documented. The default
428 (:data:`SECURITY_UNAUTHORIZED_VIEW` == ``None``) has not changed (a default HTTP 403 response).
429 The precise behavior when :data:`SECURITY_UNAUTHORIZED_VIEW` is set was never documented.
430 The important change is that Flask-Security no longer ever looks at the request.referrer header and
431 will never redirect to it. If an application needs that, it can provide a callable that can return
432 that or any other header.
433 - Configuration variables (and other things) are no longer added as attributes on the Security instance.
434 For example `security.username_enable` no longer exists - this could be an issue in code or templates.
435 For templates, Flask places `config` in the Jinja context - so rather than using an attribute, use
436 `config["SECURITY_USERNAME_ENABLE"]` for the example above.
437 - Open Redirect mitigation. Release 4.1.0 had a fix for :issue:`486` involving a potential
438 open redirect. This was very low priority since the default configuration of Werkzeug (always
439 convert the Location header to absolute URL) rendered the vulnerability un-exploitable. The solution at that
440 time was to add an optional regex looking for these bizarre URLs that from a HTTP spec perspective
441 are relative, but various browsers would interpret as absolute. In Werkzeug release 2.1 the
442 default was changed so that the Location header was allowed to be a relative URL. This made the
443 open redirect vulnerability much more likely to be exploitable. More recently, additional bizarre
444 URLs were found, as documented in :issue:`893`. More work was done and a patch release 5.3.3
445 was published. This fix utilized changing the Werkzeug default back to absolute and an updated
446 regex. Comments and thoughts by @gmanfuncky proposed a much better solution and that is in 5.4.
447 This implementation is independent of Werkzeug (and relative Location headers are again the default).
448 The entire regex option has been removed.
449 Instead, any user-supplied path used as a redirect is parsed and quoted.
450
451 Notes
452 ++++++
453 - Historically, the **current_user** proxy (managed by Flask-Login) always pointed to a user object.
454 If the user wasn't authenticated, it pointed to an AnonymousUser object. With this release,
455 setting :py:data:`SECURITY_ANONYMOUS_USER_DISABLED` to `True` will force **current_user** to be set
456 to `None` if the requesting user isn't authenticated. It should be noted that this is in support
457 of a proposal by the Pallets team to remove AnonymousUser from Flask-Login - as well as deprecating
458 the `is_authenticated` property. The default behavior (`False`) should be the same as prior releases.
459 A new function `_fs_is_user_authenticated` is now part of the render_template context that
460 templates can use instead of `current_user.is_authenticated`.
461
462 Version 5.3.3
463 -------------
464
465 Released December 29, 2023
466
467 Fixes
468 +++++
469 - (:issue:`893`) Once again work on open-redirect vulnerability - this time due to newer Werkzeug.
470 Addresses: CVE-2023-49438
471
472 Version 5.3.2
473 -------------
474
475 Released October 23, 2023
476
477 Fixes
478 ++++++
479
480 - (:issue:`859`) Update Quickstart to show how to properly handle SQLAlchemy connections.
481 - (:issue:`861`) Auth Token not returned from /tf-validate. (thanks lilz-egoto)
482 - (:pr:`864`) Fix for latest email_validator deprecation - bump minimum to 2.0.0
483 - (:pr:`865`) Deprecate passing in the anonymous_user class (sent to Flask-Login).
484
485 Version 5.3.1
486 -------------
487
488 Released October 14, 2023
489
490 **Please Note:**
491
492 - If your application uses webauthn you must use pydantic < 2.0
493 until the issue with user_handle is resolved.
494
495 Fixes
496 ++++++
497
498 - (:issue:`847`) Compatability with Flask 3.0 (wangsha)
499 - (:issue:`829`) Revert change in 5.3.0 that added a Referrer-Policy header.
500 - (:issue:`826`) Fix error in quickstart (codycollier)
501 - (:pr:`835`) Update Armenian translations (amkrtchyan-tmp)
502 - (:pr:`831`) Update German translations. (sr-verde)
503 - (:issue:`853`) Fix 'next' propagation when passed as form.next (thanks cariaso)
504
505 Version 5.3.0
506 -------------
507
508 Released July 27, 2023
509
510 This is a minor version bump due to some small backwards incompatible changes to
511 WebAuthn, recoverability (/reset), confirmation (/confirm) and the two factor validity feature.
512
513 Fixes
514 ++++++
515
516 - (:pr:`807`) Webauthn Updates to handling of transport.
517 - (:pr:`809`) Fix MongoDB support by eliminating dependency on flask-mongoengine.
518 Improve MongoDB quickstart.
519 - (:issue:`801`) Fix Quickstart for SQLAlchemy with scoped session.
520 - (:issue:`806`) Login no longer, by default, checks for email deliverability.
521 - (:issue:`791`) Token authentication is no longer accepted on endpoints which only allow
522 'session' as authentication-method. (N247S)
523 - (:issue:`814`) /reset and /confirm and GENERIC_RESPONSES and additional form args don't mix.
524 - (:issue:`281`) Reset password can be exploited and other OWASP improvements.
525 - (:pr:`817`) Confirmation can be exploited and other OWASP improvements.
526 - (:pr:`819`) Convert to pyproject.toml, build, remove setup.py/.cfg.
527 - (:pr:`823`) the tf_validity feature now ONLY sets a cookie - and the token is no longer
528 returned as part of a JSON response.
529 - (:pr:`825`) Fix login/unified signin templates to properly send CSRF token. Add more tests.
530 - (:pr:`826`) Improve Social Oauth example code.
531
532 Backwards Compatibility Concerns
533 +++++++++++++++++++++++++++++++++
534
535 - To align with the W3C WebAuthn Level2 and 3 spec - transports are now part of the registration response.
536 This has been changed BOTH in the server code (using webauthn data structures) as well as the sample
537 JavaScript code. If an application has their own JavaScript front end code - it might need to be changed.
538 - The tf_validity feature :py:data:`SECURITY_TWO_FACTOR_ALWAYS_VALIDATE` used to set a cookie if the request was
539 form based, and return the token as part of a JSON response. Now, this feature is ONLY cookie based and the token
540 is no longer returned as part of any response.
541 - Reset password was changed to adhere to OWASP recommendations and reduce possible exploitation:
542
543 - A new email (with new token) is no longer sent upon expired token. Users must restart
544 the reset password process.
545 - The user is no longer automatically logged in upon successful password reset. For
546 backwards compatibility :py:data:`SECURITY_AUTO_LOGIN_AFTER_RESET` can be set to ``True``.
547 Note that this compatibility feature is deprecated and will be removed in a future release.
548 - Identity information (identity, email) is no longer sent as part of the URL redirect
549 query params.
550 - The SECURITY_MSG_PASSWORD_RESET_EXPIRED message no longer contains the user's identity/email.
551 - The default for :py:data:`SECURITY_RESET_PASSWORD_WITHIN` has been changed from `5 days` to `1 days`.
552 - The response to GET /reset/<token> sets the HTTP header `Referrer-Policy` to `no-referrer` as suggested
553 by OWASP. *PLEASE NOTE: this was backed out in 5.3.1*
554 - Confirm email was changed to adhere to OWASP recommendations and reduce possible exploitation:
555
556 - A new email (with new token) is no longer sent upon expired token. Users must restart
557 the confirmation process.
558 - Identity information (identity, email) is no longer sent as part of the URL redirect
559 query params.
560 - The :py:data:`SECURITY_AUTO_LOGIN_AFTER_CONFIRM` configuration variable now defaults to ``False`` - meaning
561 after a successful email confirmation, the user must still sign in using the usual mechanisms. This is to
562 align better with OWASP best practices. Setting it to ``True`` will restore prior behavior.
563 - The SECURITY_MSG_CONFIRMATION_EXPIRED message no longer contains the user's identity/email.
564 - The response to GET /reset/<token> sets the HTTP header `Referrer-Policy` to `no-referrer` as suggested
565 by OWASP. *PLEASE NOTE: this was backed out in 5.3.1*
566
567 Version 5.2.0
568 -------------
569
570 Released May 6, 2023
571
572 Note: Due to rapid deprecation and removal of APIs from the Pallets team,
573 maintaining the testing of back versions of various packages is taking too
574 much time and effort. In this release only current versions of the various
575 dependent packages are being tested.
576
577 Fixes
578 +++++
579
580 - (:issue:`764`) Remove old Werkzeug compatibility check.
581 - (:issue:`777`) Compatibility with Quart.
582 - (:pr:`780`) Remove dependence on pkg_resources / setuptools (use importlib_resources package)
583 - (:pr:`792`) Fix tests to work with latest Werkzeug/Flask. Update requirements_low to match current releases.
584 - (:pr:`792`) Drop support for Python 3.7
585
586 Known Issues
587 ++++++++++++
588
589 - Flask-mongoengine hasn't released in a while and currently will not work with latest Flask and Flask-Security-Too/Flask-Security
590 (this is due to the JSONEncoder being deprecated and removed).
591
592 Backwards Compatibility Concerns
593 +++++++++++++++++++++++++++++++++
594 - The removal of pkg_resources required changing the config variable :py:data:`SECURITY_I18N_DIRNAME`.
595 If your application modified or extended this configuration variable, a small change will be required.
596
597 Version 5.1.2
598 -------------
599
600 Released March 12, 2023
601
602 Fixes
603 +++++
604
605 - (:issue:`771`) Hungarian translations not working.
606 - (:pr:`769`) Fix documentation for send_mail. (gg)
607 - (:pr:`768`) Fix for latest mongoengine and mongomock.
608 - (:pr:`766`) Fix inappropriate use of &thinsp& in French translations. (maxdup)
609 - (:pr:`773`) Improve documentation around subclassing forms.
610
611 Version 5.1.1
612 -------------
613
614 Released March 1, 2023
615
616 Fixes
617 +++++
618
619 - (:issue:`740`) Fix 2 Flask apps in same thread with USERNAME_ENABLE set.
620 There was a too aggressive config check.
621 - (:pr:`739`) Update Russian translations. (ademaro)
622 - (:pr:`743`) Run all templates through a linter. (ademaro)
623 - (:pr:`757`) Fix json/flask backwards compatibility hack.
624 - (:issue:`759`) Fix quickstarts - make sure they run using `flask run`
625 - (:pr:`755`) Fix unified signup when two-factor not enabled. (sebdroid)
626 - (:pr:`763`) Add dependency on setuptools (pkg_resources). (hroncok)
627
628 Version 5.1.0
629 -------------
630
631 Released January 23, 2023
632
633 Features
634 ++++++++
635
636 - (:issue:`667`) Expose form instantiation. See :ref:`form_instantiation`.
637 - (:issue:`693`) Option to encrypt recovery codes.
638 - (:pr:`716`) Support for authentication via 'social' oauth.
639 - (:pr:`721`) Support for Python 3.11
640
641 Fixes
642 +++++
643
644 - (:pr:`678`) Fixes for Flask-SQLAlchemy 3.0.0. (jrast)
645 - (:pr:`680`) Fixes for sqlalchemy 2.0.0 (jrast)
646 - (:issue:`697`) Webauthn and Unified signin features now properly take into
647 account blueprint prefixes.
648 - (:issue:`699`) Properly propagate `?next=/xx` - the verify, webauthn, and unified
649 signin endpoints, that had multiple redirects, needed fixes.
650 - (:pr:`696`) Add Hungarian translations. (xQwexx)
651 - (:issue:`701`) Two factor redirects ignored url_prefix. Added a :py:data:`SECURITY_TWO_FACTOR_ERROR_VIEW`
652 configuration option.
653 - (:issue:`704`) Add configurations for static folder/URL and make sure templates reference
654 blueprint relative static folder.
655 - (:issue:`709`) Make (some) templates look better by using single quotes instead of
656 double quotes.
657 - (:issue:`690`) Send entire context to MailUtil::send_mail (patrickyan)
658 - (:pr:`728`) Support for Flask-Babel 3.0.0
659 - (:issue:`692`) Add configuration option :py:data:`SECURITY_TWO_FACTOR_POST_SETUP_VIEW` which
660 is redirected to upon successful change of a two factor method.
661 - (:pr:`733`) The ability to pass in a LoginManager instance which was deprecated in
662 5.0 has been removed.
663 - (:issue:`732`) If :py:data:`SECURITY_USERNAME_REQUIRED` was ``True`` then users couldn't login
664 with just an email.
665 - (:issue:`734`) If :py:data:`SECURITY_USERNAME_ENABLE` is set, bleach is a requirement.
666 - (:pr:`736`) The unauthz_handler now takes a function name, not the function!
667
668 Backwards Compatibility Concerns
669 +++++++++++++++++++++++++++++++++
670
671 - Each form class used to be set as an attribute on the Security object. With
672 the new form instantiation model, they no longer are.
673 - After a successful update/change of a two-factor method, the user was redirected to
674 :py:data:`SECURITY_POST_LOGIN_VIEW`. Now it redirects to :py:data:`SECURITY_TWO_FACTOR_POST_SETUP_VIEW`
675 which defaults to `".two_factor_setup"`.
676 - The :meth:`.Security.unauthz_handler` now takes a function name - not the function -
677 which never made sense.
678
679 Version 5.0.2
680 -------------
681
682 Released September 23, 2022
683
684 Fixes
685 +++++
686 - (:issue:`673`) Role permissions backwards compatibility bug. For SQL based datastores
687 that use Flask-Security's models.fsqla_vx - there should be NO issues. If you declare
688 your own models - please see the 5.0.0 releases notes for required change.
689
690 Version 5.0.1
691 -------------
692
693 Released September 6, 2022
694
695 Fixes
696 +++++
697 - (:pr:`662`) Fix Change Password regression. (tysonholub)
698
699 Version 5.0.0
700 -------------
701
702 Released August 27, 2022
703
704 **PLEASE READ CHANGE NOTES CAREFULLY - THERE ARE LIKELY REQUIRED CHANGES YOU WILL HAVE TO MAKE.**
705
706 Features
707 ++++++++
708 - (:issue:`475`) Support for WebAuthn.
709 - (:issue:`479`) Support Two-factor recovery codes.
710 - (:issue:`585`) Provide option to prevent user enumeration (i.e. Generic Responses).
711 - (:pr:`532`) Support for Python 3.10.
712 - (:pr:`657`, :pr:`655`) Support for Flask >= 2.2.
713 - (:pr:`540`) Improve Templates in support of JS required by WebAuthn.
714 - (:pr:`608`) Add Icelandic translations. (ofurkusi)
715 - (:pr:`650`) Update German translations. (sr-verde)
716 - (:issue:`256`) Add custom HTML attributes to improve user experience.
717 This changed LoginForm quite a bit - please see backwards compatability concerns
718 below. The default LoginForm and template should be the same as before.
719 - (:pr:`638`) The JSON errors response has been unified. Please see backwards
720 compatibility concerns below.
721 - Updated all-inclusive data models (fsqla_v3). Add fields necessary for the new WebAuthn and
722 Two-Factor recovery codes features.
723 Changed `us_phone_number` to be unique (but not required). Changed `password` to be nullable.
724
725 Deprecations
726 ++++++++++++
727 - (:pr:`568`) Deprecate the old passwordless feature in favor of Unified Signin.
728 - (:pr:`568`) Deprecate replacing login_manager so we can possibly vendor that in in the future.
729 - (:pr:`654`) The previously deprecated methods RoleMixin.add_permissions and
730 RoleMixin.remove_permissions have been removed.
731 - (:pr:`657`) The ability to pass in a json_encoder_cls as part of initialization has been removed
732 since Flask 2.2 has deprecated and replaced that functionality.
733 - (:pr:`655`) Flask has deprecated @before_first_request. This was used mostly in examples/quickstart.
734 These have been changed to use app.app_context() prior to running the app. Flask-Security itself used it in
735 2 places - to populate `_` in jinja globals if Babel wasn't initialized and to perform
736 various configuration sanity checks w.r.t. WTF CSRF. All Flask-Security templates have been converted
737 to use `_fsdomain` rather than ``_`` so Flask-Security no longer sets ``_`` into jinja2 globals.
738 The configuration checks
739 have been moved to the end of Security::init_app() - so it is now imperative that `FlaskWTF::CSRFProtect()`
740 be called PRIOR to initializing Flask-Security.
741 - encrypt_password method has been removed. It has been deprecated since 2.0.2
742 - get_token_status has been deprecated.
743
744 Fixes
745 +++++
746 - (:pr:`591`) Make the required zxcvbn complexity score configurable. (mephi42)
747 - (:issue:`531`) Get rid of Flask-Mail. Flask-Mailman is now the default preferred email package.
748 Flask-Mail is still supported so there should be no backwards compatability issues.
749 - (:issue:`597`) A delete option has been added to us-setup (form and view).
750 - (:pr:`625`) Improve username support - the LoginForm now has a separate field for username if
751 ``SECURITY_USERNAME_ENABLE`` is True, and properly displays input fields only if the associated
752 field is an identity attribute (as specified by :py:data:`SECURITY_USER_IDENTITY_ATTRIBUTES`).
753 - (:pr:`627`) Improve empty password handling. Prior, an unguessable password was set into the user
754 record when a user registered without a password - now, the DB user model has been changed to
755 allow nullable passwords. This provides a better user experience since Flask-Security now
756 knows if a user has an empty password or not. Since registering without a password is not
757 a mainstream feature, a new configuration variable :py:data:`SECURITY_PASSWORD_REQUIRED`
758 has been added (defaults to ``True``).
759 - (:issue:`479`) A new configuration option :py:data:`SECURITY_TWO_FACTOR_RESCUE_EMAIL` has been added
760 that allows disabling that feature - defaults to backwards compatible ``True``
761 - (:issue:`658`) us_phone_number needs to be validated to be unique.
762
763
764 Backward Compatibility Concerns
765 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
766
767 For unified signin:
768
769 - The redirect after a successful us-setup used to redirect to ``SECURITY_US_POST_SETUP_VIEW`` or
770 ``SECURITY_POST_LOGIN_VIEW`` (which would default to '/'). Now it just redirects to
771 ``SECURITY_US_POST_SETUP_VIEW`` which defaults back to the ``/us-setup`` view.
772 - The ability to authenticate using a one-time email link was automatically setup by the system
773 for all users.
774 "email" now behaves like the other unified sign in methods and must be explicitly set up - with the
775 exception that if a user registers WITHOUT a password, the system will setup the one-time email link
776 option - since otherwise the user would never be able to authenticate.
777 - ``/us-signin/send-code`` didn't used to check if the user account required confirmation it just sent a code
778 and the ``/us-signin`` endpoint did the confirmation check. Now ``send-code`` does the confirmation check and
779 won't send a code unless the user is confirmed.
780 - In ``us-verify`` the 'code_methods' item now lists just active/setup methods that generate a code
781 not ALL possible methods that generate a code.
782 - ``SECURITY_US_VERIFY_SEND_CODE_URL`` and ``SECURITY_US_SIGNIN_SEND_CODE_URL`` endpoints are now POST only.
783 - Empty passwords were always permitted when ``SECURITY_UNIFIED_SIGNIN`` was enabled - now an additional configuration
784 variable ``SECURITY_PASSWORD_REQUIRED`` must be set to False.
785 - ``SECURITY_US_VERIFY_SEND_CODE_URL`` and ``SECURITY_US_SIGNIN_SEND_CODE_URL`` used to send ``code_sent`` to the template.
786 Now they flash the ``SECURITY_MSG_CODE_HAS_BEEN_SENT`` message.
787 - With the addition of being able to delete a previously setup up sign in method, the signal `us_profile_changed` arguments
788 have changed. `method` is now `methods` and is a list, and a new argument `delete` is True if a sign in option was deleted.
789
790 Login:
791
792 - Since the beginning of time, the flask-security login form has accepted any input in the
793 'email' field, and used that to check if it corresponds to any field in ``SECURITY_USER_IDENTITY_ATTRIBUTES``.
794 This has always been problematic and confusing - and with the addition of HTML attributes for various
795 form fields - having a field with multiple possible inputs is no longer a viable user experience.
796 This is no longer supported, and the LoginForm now declares the ``email`` field to be of type ``EmailField``
797 which requires a valid (after normalization) email address. The most common usage of this legacy feature was to allow
798 an email or username - Flask-Security now has core support for a ``username`` option - see :py:data:`SECURITY_USERNAME_ENABLE`.
799 Please see :ref:`custom_login_form` for an example of how to replicate the legacy behavior.
800 - Some error messages have changed - ``USER_DOES_NOT_EXIST`` is now returned for any identity error including an empty value.
801
802 Other:
803
804 - A very old piece of code in registrable, would immediately commit to the DB when a new user was created.
805 It is now consistent with all other views, and has the caller responsible for committing the transaction - usually by
806 setting up a flask ``after_this_request`` action. This could affect an application that captured the registration signal
807 and stored the ``user`` object for later use - this user object would likely be invalid after the request is finished.
808 - Some fields have custom HTML attributes attached to them (e.g. autocomplete, type, etc). These are stored as part of the
809 form in the ``render_kw`` attribute. This could cause some confusion if an app had its own templates and set different
810 attributes.
811 - The keys for "/tf-rescue" select options have changed to be more 'action' oriented:
812
813 - `lost_device` -> `email`
814 - `no_mail_access` -> `help`
815 - JSON error responses. **THIS IS A BREAKING CHANGE**.
816 In earlier releases, the JSON error response could have either a `error` key which was for rare cases
817 where there was a single non-form related error, or an `errors` key which was a a dict as defined by WTForms.
818 Now, the `errors` key will contain a list of (localized) messages - both non-form related as well as any form related.
819 The key `field_errors` will contain the dict as specified by WTForms. Please note that starting with WTForms 3.0
820 form-level errors are supported and show up in the dict with the field name/key of "none". There are no changes to non-error
821 related JSON responses.
822 - Permissions **THIS IS A BREAKING CHANGE**. The Role Model now stores permissions as a list, and requires that the underlying DB ORM map that to a supported
823 DB type. For SQLAlchemy, this is mapped to a comma separated string (as before). For
824 SQLAlchemy DBs the underlying Column type (UnicodeText) didn't change so no data migration should be required.
825 However, the ORM Column type did change and requires the following change to your model::
826
827 from flask_security import AsaList
828 from sqlalchemy.ext.mutable import MutableList
829 class Role(Base, RoleMixin):
830 ...
831 permissions = Column(MutableList.as_mutable(AsaList()), nullable=True)
832 ...
833
834 If your application makes use of Flask-Security's models.fsqla_vX classes - no changes are required.
835 For Mongo, a ListField can be directly used.
836 - CSRF - As mentioned above, it is now required that `FlaskWTF::CSRFProtect()`, if used, must be called PRIOR to initializing Flask-Security.
837 - json_encoder_cls - As mentioned above - Flask-Security initialization no longer accepts overriding the json_encoder class. If this is required,
838 update to Flask >=2.2 and implement Flask's JSONProvider interface.
839
840 For templates:
841
842 - Pretty much every template was modified to replace <p> with <div class=xx> to make
843 styling possible and to make more complex forms more readable.
844 - Many forms had places where things weren't properly localizable - that has (hopefully) been fixed.
845 - The ``us_setup.html`` template was modified to add ability to delete an existing set up method.
846
847 DB Migration
848 ~~~~~~~~~~~~
849
850 To use the new WebAuthn feature a new table and two new columns in the User model are required.
851 To ease updates - Flask-Security will automatically create a fs_webauthn_user_handle
852 upon first use for existing users.
853 If you are using Alembic the schema migration is easy::
854
855 op.add_column('user', sa.Column('fs_webauthn_user_handle', sa.String(length=64), nullable=True, unique=True))
856
857
858 If you want to allow for empty passwords as part of registration then set :py:data:`SECURITY_PASSWORD_REQUIRED` to ``False``.
859 In addition you need to change your DB schema to allow the ``password`` field to be nullable.
860
861 Version 4.1.5
862 -------------
863
864 Released July 28, 2022
865
866 Fixes
867 +++++
868 - (:pr:`644`) Fix test and other failures with newer Flask-Login/Werkzeug versions.
869
870 Version 4.1.4
871 -------------
872
873 Released April 19, 2022
874
875 Fixes
876 +++++
877 - (:issue:`594`) Fix test failures with newer Flask versions.
878
879 Version 4.1.3
880 -------------
881
882 Released March 2, 2022
883
884 Fixes
885 +++++
886 - (:issue:`581`) Fix bug when attempting to disable register_blueprint. (halali)
887 - (:pr:`539`) Fix example documentation re: generating localized messages. (kazuhei2)
888 - (:pr:`546`) Make roles joinedload compatible with SQLAlchemy 2.0. (keats)
889 - (:pr:`586`) Ship py.typed as part of package.
890 - (:issue:`580`) Improve documentation around use of bleach and include in common install extra.
891
892 Version 4.1.2
893 -------------
894
895 Released September 22, 2021
896
897 Fixes
898 +++++
899 - (:issue:`526`) default_reauthn_handler doesn't honor SECURITY_URL_PREFIX
900 - (:pr:`528`) Improve German translations (sr-verde)
901 - (:pr:`527`) Fix two-factor sample code (djpnewton)
902
903 Version 4.1.1
904 --------------
905
906 Released September 10, 2021
907
908 Fixes
909 +++++
910 - (:issue:`518`) Fix corner case where Security object was being reused in tests.
911 - (:issue:`512`) If USERNAME_ENABLE is set, change LoginForm field from EmailField
912 to StringField. Also - dynamically add fields to Login and Registration forms
913 rather than always having them - this made the RegistrationForm much simpler.
914 - (:issue:`516`) Improved username feature handling solved issue of always requiring
915 bleach.
916 - (:issue:`513`) Improve documentation of default username validation.
917
918 Version 4.1.0
919 -------------
920
921 Released July 23, 2021
922
923 Features
924 ++++++++
925 - (:issue:`474`) Add public API and CLI command to change a user's password.
926 - (:issue:`140`) Add type hints. Please note that many of the packages that flask-security
927 depends on aren't typed yet - so there are likely errors in some of the types.
928 - (:issue:`466`) Add first-class support for using username for signing in.
929
930 Fixes
931 +++++
932 - (:issue:`483`) 4.0 doesn't accept 3.4 authentication tokens. (kuba-lilz)
933 - (:issue:`490`) Flask-Mail sender name can be a tuple. (hrishikeshrt)
934 - (:issue:`486`) Possible open redirect vulnerability.
935 - (:pr:`478`) Improve/update German translation. (sr-verde)
936 - (:issue:`488`) Improve handling of Babel packages.
937 - (:pr:`496`) Documentation improvements, distribution extras, fix single message
938 override.
939 - (:issue:`497`) Improve cookie handling and default ``samesite`` to ``Strict``.
940
941 Backwards Compatibility Concerns
942 +++++++++++++++++++++++++++++++++
943 - (:pr:`488`) In 4.0.0, with the addition of Flask-Babel support, Flask-Security enforced that
944 if it could import either Flask-Babel or Flask-BabelEx, that those modules had
945 been initialized as proper Flask extensions. Prior to 4.0.0, just Flask-BabelEx
946 was supported - and that didn't require any explicit initialization. Flask-Babel
947 DOES require explicit initialization. However for some applications that don't
948 completely control their environment (such as system pre-installed versions of
949 python) this caused applications that didn't even want translation services to
950 fail on startup. With this release, Flask-Security still attempts to import
951 one or the other package - however if those modules are NOT initialized,
952 Flask-Security will simply ignore them and no translations will occur.
953 - (:issue:`497`) The CSRF_COOKIE and TWO_FACTOR_VALIDITY cookie had their defaults
954 changed to set ``samesite=Strict``. This follows the Flask-Security goal of
955 making things more secure out-of-the-box.
956 - (:issue:`140`) Type hinting. For the most part this of course has no runtime effects.
957 However, this required a fairly major overhaul of how Flask-Security is initialized in
958 order to provide valid types for the many constructor attributes. There are no known
959 compatability concerns - however initialization used to convert all arguments into kwargs
960 then add those as attributes and merge with application constants. That no longer happens
961 and it is possible that some corner cases don't behave precisely as they did before.
962
963 Version 4.0.1
964 -------------
965
966 Released April 2, 2021
967
968 Features
969 ++++++++
970
971 Fixes
972 +++++
973 - (:issue:`461`) 4.0 doesn't accept 3.4 authentication tokens. (kuba-lilz)
974 - (:issue:`460`) 2-fa error: Failed to send code - improved documentation and debuggability.
975 - (:issue:`454`) 2-fa error: TypeError - fixed documentation.
976 - (:issue:`443`) Calling create user without any arguments - fixed underlying cause
977 of translating form errors in the CLI.
978 - (:issue:`442`) Email validation confusion - added documentation.
979 - (:issue:`450`) Add documentation on how to override specific error messages.
980 - (:pr:`439`) Don't install global-scope tests. (mgorny)
981 - (:pr:`470`) Add note about updating DB using MySQL. (jugmac00)
982 - (:pr:`468`) Fix documentation - uia_phone_number should be uia_phone_mapper. (dvrg)
983 - (:pr:`457`) Improve chinese translations. (zxjlm)
984 - (:pr:`453`) Improve basque and spanish translations. (mmozos)
985 - (:pr:`448`) Add Afrikaans translations. (lonelyvikingmichael)
986 - (:pr:`467`) Add Blinker as explicit dependency, improve/fix celery usage docs,
987 dont require pyqrcode unless authenticator configured, improve SMS configuration
988 variables documentation.
989
990
991
992 Version 4.0.0
993 -------------
994
995 Released January 26, 2021
996
997 **PLEASE READ CHANGE NOTES CAREFULLY - THERE ARE LIKELY REQUIRED CHANGES YOU WILL HAVE TO MAKE TO EVEN START YOUR APPLICATION WITH 4.0**
998
999 Start Here
1000 +++++++++++
1001 - Your UserModel must contain ``fs_uniquifier``
1002 - Either uninstall Flask-BabelEx (if you don't need translations) or add either Flask-Babel (>=2.0) or Flask-BabelEx to your
1003 dependencies AND be sure to initialize it in your app.
1004 - Add Flask-Mail to your dependencies.
1005 - If you have unicode emails or passwords read change notes below.
1006
1007 Version 4.0.0rc2
1008 ----------------
1009
1010 Released January 18, 2021
1011
1012 Features & Cleanup
1013 +++++++++++++++++++
1014 - Removal of python 2.7 and <3.6 support
1015 - Removal of token caching feature (a relatively new feature that had some systemic issues)
1016 - (:pr:`328`) Remove dependence on Flask-Mail and refactor.
1017 - (:pr:`335`) Remove two-factor `/tf-confirm` endpoint and use generic `freshness` mechanism.
1018 - (:pr:`336`) Remove ``SECURITY_BACKWARDS_COMPAT_AUTH_TOKEN_INVALID(ATE)``. In addition to
1019 not making sense - the documentation has never been correct.
1020 - (:pr:`339`) Require ``fs_uniquifier`` in the UserModel and stop using/referencing the UserModel
1021 primary key.
1022 - (:pr:`349`) Change ``SECURITY_USER_IDENTITY_ATTRIBUTES`` configuration variable semantics.
1023 - Remove (all?) requirements around having an 'email' column in the UserModel. API change -
1024 JSON SPA redirects used to always include a query param 'email=xx'. While that is still sent
1025 (if and only if) the UserModel contains an 'email' columns, a new query param 'identity' is returned
1026 which returns the value of :meth:`.UserMixin.calc_username()`.
1027 - (:pr:`382`) Improvements and documentation for two-factor authentication.
1028 - (:pr:`394`) Add support for email validation and normalization (see :class:`.MailUtil`).
1029 - (:issue:`231`) Normalize unicode passwords (see :class:`.PasswordUtil`).
1030 - (:issue:`391`) Option to redirect to `/confirm` if user hits an endpoint that requires
1031 confirmation. New option :py:data:`SECURITY_REQUIRES_CONFIRMATION_ERROR_VIEW` which if set and the user
1032 hits the `/login`, `/reset`, or `/us-signin` endpoint, and they require confirmation the response will be a redirect. (SnaKyEyeS)
1033 - (:issue:`366`) Allow redirects on sub-domains. Please see :py:data:`SECURITY_REDIRECT_ALLOW_SUBDOMAINS`. (willcroft)
1034 - (:pr:`376`) Have POST redirects default to Flask's ``APPLICATION_ROOT``. Previously the default configuration was ``/``.
1035 Now it first looks at Flask's `APPLICATION_ROOT` configuration and uses that (which also by default is ``/``. (tysonholub)
1036 - (:pr:`401`) Add 2FA Validity Window so an application can configure how often the second factor has to be entered. (baurt)
1037 - (:pr:`403`) Add HTML5 Email input types to email fields. This has some backwards compatibility concerns outlined below. (drola)
1038 - (:pr:`413`) Add hy_AM translations. (rudolfamirjanyan)
1039 - (:pr:`410`) Add Basque and fix Spanish translations. (mmozos)
1040 - (:pr:`408`) Polish translations. (kamil559)
1041 - (:pr:`390`) Update ru_RU translations. (TitaniumHocker)
1042
1043 Fixed
1044 +++++
1045 - (:issue:`389`) Fixes for translations. First - email subjects were never being translated. Second, converted
1046 all templates to use _fsdomain(xx) rather than _(xx) so that they get translated regardless of the app's domain.
1047 - (:issue:`381`) Support Flask-Babel 2.0 which has backported Domain support. Flask-Security now supports
1048 Flask-Babel (>=2.00), Flask-BabelEx, as well as no translation support. Please see backwards compatibility notes below.
1049 - (:pr:`352`) Fix issue with adding/deleting permissions - all mutating methods must be at the datastore layer so that
1050 db.put() can be called. Added :meth:`.UserDatastore.add_permissions_to_role` and :meth:`.UserDatastore.remove_permissions_from_role`.
1051 The methods `.RoleMixin.add_permissions` and `.RoleMixin.remove_permissions` have been deprecated.
1052 - (:issue:`395`) Provide ability to change table names for User and Role tables in the fsqla model.
1053 - (:issue:`338`) All sessions are invalidated when a user changes or resets their password. This is accomplished by
1054 changing the user's `fs_uniquifier`. The user is automatically re-logged in (and a new session
1055 created) after a successful change operation.
1056 - (:issue:`418`) Two-factor (and to a lesser extent unified sign in) QRcode fetching wasn't protected via CSRF. The
1057 fix makes things secure and simpler (always good); however read below for compatibility concerns. In addition, the elements that make up the QRcode (key, username, issuer) area also made available to the form
1058 and returned as part of the JSON return value - this allows for manual or other ways to initialize the authenticator
1059 app.
1060 - (:issue:`421`) GET on `/login` and `/change` could return the callers authentication_token. This is a security
1061 concern since GETs don't have CSRF protection. This bug was introduced in 3.3.0.
1062
1063 Backwards Compatibility Concerns
1064 +++++++++++++++++++++++++++++++++
1065 - (:pr:`328`) Remove dependence on Flask-Mail and refactor. The ``send_mail_task`` and
1066 ``send_mail`` methods as part of Flask-Security initialization
1067 have been removed and replaced with a new :class:`.MailUtil` class.
1068 The utility method :func:`.send_mail` can still be used.
1069 If your application didn't use either of the deprecated methods, then the only change required
1070 is to add Flask-Mail to your package requirements (since Flask-Security no longer lists it).
1071 Please see the :ref:`emails_topic` for updated examples.
1072
1073 - (:pr:`335`) Convert two-factor setup flow to use the freshness feature rather than
1074 its own verify password endpoint. This COMPLETELY removes the ``/tf-confirm`` endpoint
1075 and associated form: ``two_factor_verify_password_form``. Now, when /tf-setup is invoked,
1076 the :meth:`flask_security.check_and_update_authn_fresh` is invoked, and if the current session isn't 'fresh'
1077 the caller will be redirected to a verify endpoint (either :py:data:`SECURITY_VERIFY_URL` or
1078 :py:data:`SECURITY_US_VERIFY_URL`). The simplest change would be to call ``/verify`` everywhere
1079 the application used to call ``/tf-confirm``.
1080
1081 - (:pr:`339`) Require ``fs_uniquifier``. In 3.3 the ``fs_uniquifier`` was added in the UserModel to fix
1082 the slow authentication token issue. In 3.4 the ``fs_uniquifier`` was used to implement Flask-Login's
1083 `Alternative Token` feature - thus decoupling the primary key (id) from any security context.
1084 All along, there have been a few issues with applications not wanting to use the name 'id' in their
1085 model, or wanting a different type for their primary key. With this change, Flask-Security no longer
1086 interprets or uses the UserModel primary key - just the ``fs_uniquifier`` field. See the changes section for 3.3
1087 for information on how to do the schema and data upgrades required to add this field. There is also an API change -
1088 the JSON response (via UserModel.get_security_payload()) returned the ``user.id`` field. With this change
1089 the default is an empty directory - override :meth:`.UserMixin.get_security_payload()` to return any portion of the UserModel you need.
1090
1091 - (:pr:`349`) :py:data:`SECURITY_USER_IDENTITY_ATTRIBUTES` has changed syntax and semantics. It now contains
1092 the combined information from the old ``SECURITY_USER_IDENTITY_ATTRIBUTES`` and the newly introduced in 3.4 :py:data:`SECURITY_USER_IDENTITY_MAPPINGS`.
1093 This enabled changing the underlying way we validate credentials in the login form and unified sign in form.
1094 In prior releases we simply tried to look up the form value as the PK of the UserModel - this often failed and then
1095 looped through the other ``SECURITY_USER_IDENTITY_ATTRIBUTES``. This had a history of issues, including many applications not
1096 wanting to have a standard PK for the user model. Now, using the mapping configuration, the UserModel attribute/column the input
1097 corresponds to is determined, then the UserModel is queried specifically for that *attribute:value* pair. If you application
1098 didn't change the variable, no modifications are required.
1099
1100 - (:pr:`354`) The :class:`flask_security.PhoneUtil` is now initialized as part of Flask-Security initialization rather than
1101 ``@app.before_first_request`` (since that broke the CLI). Since it isn't called in an application context, the *app* being initialized is
1102 passed as an argument to *__init__*.
1103
1104 - (:issue:`381`) When using Flask-Babel (>= 2.0) it is required that the application initialize Flask-Babel (e.g. Babel(app)).
1105 Flask-BabelEx would self-initialize so it didn't matter. Flask-Security will throw a run time error upon first request if Flask-Babel
1106 OR FLask-BabelEx
1107 is installed, but not initialized. Also, Flask-Security no longer has a dependency on either Flask-Babel or Flask-BabelEx - if neither
1108 are installed, it falls back to a dummy translation. *If your application expects translation services, it must specify the appropriate*
1109 *dependency AND initialize it.*
1110
1111 - (:pr:`394`) Email input is now normalized prior to being stored in the DB. Previously, it was validated, but the raw input
1112 was stored. Normalization and validation rely on the `email_validator <https://pypi.org/project/email-validator/>`_ package.
1113 The :class:`.MailUtil` class provides the interface for normalization and validation - allowing all this to be customized.
1114 If you have unicode local or domain parts - existing users may have difficulties logging in. Administratively you need to
1115 read each user record, normalize the email (see :class:`.MailUtil`), and write it back.
1116
1117 - (:issue:`381`) Passwords are now, by default, normalized using Python's unicodedata.normalize() method.
1118 The :py:data:`SECURITY_PASSWORD_NORMALIZE_FORM` defaults to "NKFD". This brings Flask-Security
1119 in line with the NIST recommendations outlined in `Memorized Secret Verifiers <https://pages.nist.gov/800-63-3/sp800-63b.html#sec5>`_
1120 If your users have unicode passwords
1121 they may have difficulty authenticating. You can turn off this normalization or have your users reset their passwords.
1122 Password normalization and validation has been encapsulated in a new :class:`.PasswordUtil` class. This replaces
1123 the method ``password_validator`` introduced in 3.4.0.
1124
1125 - (:pr:`403`) By default all forms that have an email as input now use the wtforms html5 ``EmailField``. For most applications this will
1126 make the user experience slightly nicer - especially for mobile devices. Some applications use the email form field for other
1127 identity attributes (such as username). If your application does this you will probably need to subclass ``LoginForm`` and change
1128 the email type back to StringField.
1129
1130 - (:issue:`338`) By default, both passwords and authentication tokens use the same attribute ``fs_uniquifier`` to
1131 uniquely identify the user. This means that if the user changes or resets their password, all authentication tokens
1132 also become invalid. This could be viewed as a feature or a bug. If this behavior isn't desired, add another
1133 uniquifier: ``fs_token_uniquifier`` to your UserModel and that will be used to generate authentication tokens.
1134
1135 - (:issue:`418`) Fix CSRF vulnerability w.r.t. getting QRcodes. Both two-factor and unified-signup had a separate
1136 GET endpoint to fetch the QRcode when setting up an authenticator app. GETS don't have any CSRF protection. Both
1137 of those endpoints have been completely removed, and the QRcode is embedded in a successful POST of the setup form.
1138 The changes to the templates are minimal and of course if you didn't override the template - there is no
1139 compatibility concern.
1140
1141 - (:issue:`421`) Fix CSRF vulnerability on `/login` and `/change` that could return the callers authentication token.
1142 Now, callers can only get the authentication token on successful POST calls.
1143
1144 Version 3.4.5
1145 --------------
1146
1147 Released January 8, 2021
1148
1149 Security Vulnerability Fix.
1150
1151 Two CSRF vulnerabilities were reported: `qrcode`_ and `login`_. This release
1152 fixes the more severe of the 2 - the `/login` vulnerability. The QRcode issue
1153 has a much smaller risk profile since a) it is only for two-factor authentication
1154 using an authenticator app b) the qrcode is only available during the time
1155 the user is first setting up their authentication app.
1156 The QRcode issue has been fixed in 4.0.
1157
1158 .. _qrcode: https://github.com/pallets-eco/flask-security/issues/418
1159 .. _login: https://github.com/pallets-eco/flask-security/issues/421
1160
1161 Fixed
1162 +++++
1163
1164 - (:issue:`421`) GET on `/login` and `/change` could return the callers authentication_token. This is a security
1165 concern since GETs don't have CSRF protection. This bug was introduced in 3.3.0.
1166
1167 Backwards Compatibility Concerns
1168 ++++++++++++++++++++++++++++++++
1169
1170 - (:issue:`421`) Fix CSRF vulnerability on `/login` and `/change` that could return the callers authentication token.
1171 Now, callers can only get the authentication token on successful POST calls.
1172
1173 Version 3.4.4
1174 --------------
1175
1176 Released July 27, 2020
1177
1178 Bug/regression fixes.
1179
1180 Fixed
1181 +++++
1182
1183 - (:issue:`359`) Basic Auth broken. When the unauthenticated handler was changed to provide a more
1184 uniform/consistent response - it broke using Basic Auth from a browser, since it always redirected rather than
1185 returning 401. Now, if the response headers contain ``WWW-Authenticate``
1186 (which is set if ``basic`` @auth_required method is used), a 401 is returned. See below
1187 for backwards compatibility concerns.
1188
1189 - (:pr:`362`) As part of figuring out issue 359 - a redirect loop was found. In release 3.3.0 code was put
1190 in to redirect to :py:data:`SECURITY_POST_LOGIN_VIEW` when GET or POST was called and the caller was already authenticated. The
1191 method used would honor the request ``next`` query parameter. This could cause redirect loops. The pre-3.3.0 behavior
1192 of redirecting to :py:data:`SECURITY_POST_LOGIN_VIEW` and ignoring the ``next`` parameter has been restored.
1193
1194 - (:issue:`347`) Fix peewee. Turns out - due to lack of unit tests - peewee hasn't worked since
1195 'permissions' were added in 3.3. Furthermore, changes in 3.4 around get_id and alternative tokens also
1196 didn't work since peewee defines its own `get_id` method.
1197
1198 Compatibility Concerns
1199 ++++++++++++++++++++++
1200
1201 In 3.3.0, :meth:`flask_security.auth_required` was changed to add a default argument if none was given. The default
1202 include all current methods - ``session``, ``token``, and ``basic``. However ``basic`` really isn't like the others
1203 and requires that we send back a ``WWW-Authenticate`` header if authentication fails (and return a 401 and not redirect).
1204 ``basic`` has been removed from the default set and must once again be explicitly requested.
1205
1206 Version 3.4.3
1207 -------------
1208
1209 Released June 12, 2020
1210
1211 Minor fixes for a regression and a couple other minor changes
1212
1213 Fixed
1214 +++++
1215
1216 - (:issue:`340`) Fix regression where tf_phone_number was required, even if SMS wasn't configured.
1217 - (:pr:`342`) Pick up some small documentation fixes from 4.0.0.
1218
1219 Version 3.4.2
1220 -------------
1221
1222 Released May 2, 2020
1223
1224 Only change is to move repo to the Flask-Middleware github organization.
1225
1226 Version 3.4.1
1227 --------------
1228
1229 Released April 22, 2020
1230
1231 Fix a bunch of bugs in new unified sign in along with a couple other major issues.
1232
1233 Fixed
1234 +++++
1235 - (:issue:`298`) Alternative ID feature ran afoul of postgres/psycopg2 finickiness.
1236 - (:issue:`300`) JSON 401 responses had WWW-Authenticate Header attached - that caused
1237 browsers to pop up their own login/password form. Not what applications want.
1238 - (:issue:`280`) Allow admin/api to setup TFA (and unified sign in) out of band.
1239 Please see :meth:`.UserDatastore.tf_set`, :meth:`.UserDatastore.tf_reset`,
1240 :meth:`.UserDatastore.us_set`, :meth:`.UserDatastore.us_reset` and
1241 :meth:`.UserDatastore.reset_user_access`.
1242 - (:pr:`305`) We used form._errors which wasn't very pythonic, and it was
1243 removed in WTForms 2.3.0.
1244 - (:pr:`310`) WTForms 2.3.0 made email_validator optional - we need it.
1245
1246
1247 Version 3.4.0
1248 -------------
1249
1250 Released March 31, 2020
1251
1252 Features
1253 ++++++++
1254 - (:pr:`257`) Support a unified sign in feature. Please see :ref:`configuration:unified signin`.
1255 - (:pr:`265`) Add phone number validation class. This is used in both unified sign in
1256 as well as two-factor when using ``sms``.
1257 - (:pr:`274`) Add support for 'freshness' of caller's authentication. This permits endpoints
1258 to be additionally protected by ensuring a recent authentication.
1259 - (:issue:`99`, :issue:`195`) Support pluggable password validators. Provide a default
1260 validator that offers complexity and breached support.
1261 - (:issue:`266`) Provide interface to two-factor send_token so that applications
1262 can provide error mitigation. Defaults to returning errors if can't send the verification code.
1263 - (:pr:`247`) Updated all-inclusive data models (fsqlaV2). Add fields necessary for the new unified sign in feature
1264 and changed 'username' to be unique (but not required).
1265 - (:pr:`245`) Use fs_uniquifier as the default Flask-Login 'alternative token'. Basically
1266 this means that changing the fs_uniquifier will cause outstanding auth tokens, session and remember me
1267 cookies to be invalidated. So if an account gets compromised, an admin can easily stop access. Prior to this
1268 cookies were storing the 'id' which is the user's primary key - difficult to change! (kishi85)
1269
1270 Fixed
1271 +++++
1272 - (:issue:`273`) Don't allow reset password for accounts that are disabled.
1273 - (:issue:`282`) Add configuration that disallows GET for logout. Allowing GET can
1274 cause some denial of service issues. The default still allows GET for backwards
1275 compatibility. (kantorii)
1276 - (:issue:`258`) Reset password wasn't integrated into the two-factor feature and therefore
1277 two-factor auth could be bypassed.
1278 - (:issue:`254`) Allow lists and sets as underlying permissions. (pffs)
1279 - (:issue:`251`) Allow a registration form to have additional fields that aren't part of the user model
1280 that are just passed to the user_registered.send signal, where the application can perform arbitrary
1281 additional actions required during registration. (kuba-lilz)
1282 - (:issue:`249`) Add configuration to disable the 'role-joining' optimization for SQLAlchemy. (pffs)
1283 - (:issue:`238`) Fix more issues with atomically setting the new TOTP secret when setting up two-factor. (kishi85)
1284 - (:pr:`240`) Fix Quart Compatibility. (ristellise)
1285 - (:issue:`232`) CSRF Cookie not being set when using 'Remember Me' cookie to re-sign in. (kishi85)
1286 - (:issue:`229`) Two-factor enabled accounts didn't work with the Remember Me feature. (kishi85)
1287
1288 As part of adding unified sign in, there were many similarities with two-factor.
1289 Some refactoring was done to unify naming, configuration variables etc.
1290 It should all be backwards compatible.
1291
1292 - In TWO_FACTOR_ENABLED_METHODS "mail" was changed to "email". "mail" will still
1293 be honored if already stored in DB. Also "google_authenticator" is now just "authenticator".
1294 - TWO_FACTOR_SECRET, TWO_FACTOR_URI_SERVICE_NAME, TWO_FACTOR_SMS_SERVICE, and TWO_FACTOR_SMS_SERVICE_CONFIG
1295 have all been deprecated in favor of names that are the same for two-factor and unified sign in.
1296
1297 Other changes with possible backwards compatibility issues:
1298
1299 - ``/tf-setup`` never did any phone number validation. Now it does.
1300 - ``two_factor_setup.html`` template - the chosen_method check was changed to ``email``.
1301 If you have your own custom template - be sure make that change.
1302
1303 Version 3.3.3
1304 -------------
1305
1306 Released February 11, 2020
1307
1308 Minor changes required to work with latest released Werkzeug and Flask-Login.
1309
1310 Version 3.3.2
1311 -------------
1312
1313 Released December 7, 2019
1314
1315 - (:issue:`215`) Fixed 2FA totp secret regeneration bug (kishi85)
1316 - (:issue:`172`) Fixed 'next' redirect error in login view
1317 - (:issue:`221`) Fixed regressions in login view when already authenticated user
1318 again does a GET or POST.
1319 - (:issue:`219`) Added example code for unit testing FS protected routes.
1320 - (:issue:`223`) Integrated two-factor auth into registration and confirmation.
1321
1322 Thanks to kuba-lilz and kishi85 for finding and providing detailed issue reports.
1323
1324 In Flask-Security 3.3.0 the login view was changed to allow already authenticated
1325 users to access the view. Prior to 3.3.0, the login view was protected with
1326 @anonymous_user_required - so any access (via GET or POST) would simply redirect
1327 the user to the ``POST_LOGIN_VIEW``. With the 3.3.0 changes, both GET and POST
1328 behaved oddly. GET simply returned the login template, and POST attempted to
1329 log out the current user, and log in the new user. This was problematic since
1330 this couldn't possibly work with CSRF.
1331 The old behavior has been restored, with the subtle change that older Flask-Security
1332 releases did not look at "next" in the form or request for the redirect,
1333 and now, all redirects from the login view will honor "next".
1334
1335 Version 3.3.1
1336 -------------
1337
1338 Released November 16, 2019
1339
1340 - (:pr:`197`) Add `Quart <https://gitlab.com/pgjones/quart/>`_ compatibility (Ristellise)
1341 - (:pr:`194`) Add Python 3.8 support into CI (jdevera)
1342 - (:pr:`196`) Improve docs around Single Page Applications and React (acidjunk)
1343 - (:issue:`201`) fsqla model was added to __init__.py making Sqlalchemy a required package.
1344 That is wrong and has been removed. Applications must now explicitly import from ``flask_security.models``
1345 - (:pr:`204`) Fix/improve examples and quickstart to show one MUST call hash_password() when
1346 creating users programmatically. Also show real SECRET_KEYs and PASSWORD_SALTs and how to generate them.
1347 - (:pr:`209`) Add argon2 as an allowable password hash.
1348 - (:pr:`210`) Improve integration with Flask-Admin. Actually - this PR improves localization support
1349 by adding a method ``_fsdomain`` to jinja2's global environment. Added documentation
1350 around localization.
1351
1352
1353 Version 3.3.0
1354 -------------
1355
1356 Released September 26, 2019
1357
1358 **There are several default behavior changes that might break existing applications.
1359 Most have configuration variables that restore prior behavior**.
1360
1361 **If you use Authentication Tokens (rather than session cookies) you MUST make a (small) change.
1362 Please see below for details.**
1363
1364 - (:pr:`120`) Native support for Permissions as part of Roles. Endpoints can be
1365 protected via permissions that are evaluated based on role(s) that the user has.
1366 - (:issue:`126`, :issue:`93`, :issue:`96`) Revamp entire CSRF handling. This adds support for Single Page Applications
1367 and having CSRF protection for browser(session) authentication but ignored for
1368 token based authentication. Add extensive documentation about all the options.
1369 - (:issue:`156`) Token authentication is slow. Please see below for details on how to enable a new, fast implementation.
1370 - (:issue:`130`) Enable applications to provide their own :meth:`.render_json` method so that they can create
1371 unified API responses.
1372 - (:issue:`121`) Unauthorized callback not quite right. Split into 2 different callbacks - one for
1373 unauthorized and one for unauthenticated. Made default unauthenticated handler use Flask-Login's unauthenticated
1374 method to make everything uniform. Extensive documentation added. `.Security.unauthorized_callback` has been deprecated.
1375 - (:pr:`120`) Add complete User and Role model mixins that support all features. Modify tests and Quickstart documentation
1376 to show how to use these. Please see :ref:`responsetopic` for details.
1377 - Improve documentation for :meth:`.UserDatastore.create_user` to make clear that hashed password
1378 should be passed in.
1379 - Improve documentation for :class:`.UserDatastore` and :func:`.verify_and_update_password`
1380 to make clear that caller must commit changes to DB if using a session based datastore.
1381 - (:issue:`122`) Clarify when to use ``confirm_register_form`` rather than ``register_form``.
1382 - Fix bug in 2FA that didn't commit DB after using `verify_and_update_password`.
1383 - Fix bug(s) in UserDatastore where changes to user ``active`` flag weren't being added to DB.
1384 - (:issue:`127`) JSON response was failing due to LazyStrings in error response.
1385 - (:issue:`117`) Making a user inactive should stop all access immediately.
1386 - (:issue:`134`) Confirmation token can no longer be reused. Added
1387 *SECURITY_AUTO_LOGIN_AFTER_CONFIRM* option for applications that don't want the user
1388 to be automatically logged in after confirmation (defaults to True - existing behavior).
1389 - (:issue:`159`) The ``/register`` endpoint returned the Authentication Token even though
1390 confirmation was required. This was a huge security hole - it has been fixed.
1391 - (:issue:`160`) The 2FA totp_secret would be regenerated upon submission, making QRCode not work. (malware-watch)
1392 - (:issue:`166`) `default_render_json` uses ``flask.make_response`` and forces the Content-Type to JSON for generating the response (koekie)
1393 - (:issue:`166`) *SECURITY_MSG_UNAUTHENTICATED* added to the configuration.
1394 - (:pr:`168`) When using the @auth_required or @auth_token_required decorators, the token
1395 would be verified twice, and the DB would be queried twice for the user. Given how slow
1396 token verification is - this was a significant issue. That has been fixed.
1397 - (:issue:`84`) The :func:`.anonymous_user_required` was not JSON friendly - always
1398 performing a redirect. Now, if the request 'wants' a JSON response - it will receive a 400 with an error
1399 message defined by *SECURITY_MSG_ANONYMOUS_USER_REQUIRED*.
1400 - (:pr:`145`) Improve 2FA templates to that they can be localized. (taavie)
1401 - (:issue:`173`) *SECURITY_UNAUTHORIZED_VIEW* didn't accept a url (just an endpoint). All other view
1402 configurations did. That has been fixed.
1403
1404 Possible compatibility issues
1405 +++++++++++++++++++++++++++++
1406
1407 - (:pr:`164`) In prior releases, the Authentication Token was returned as part of the JSON response to each
1408 successful call to `/login`, `/change`, or `/reset/{token}` API call. This is not a great idea since
1409 for browser-based UIs that used JSON request/response, and used session based authentication - they would
1410 be sent this token - even though it was likely ignored. Since these tokens by default have no expiration time
1411 this exposed a needless security hole. The new default behavior is to ONLY return the Authentication Token from those APIs
1412 if the query param ``include_auth_token`` is added to the request. Prior behavior can be restored by setting
1413 the *SECURITY_BACKWARDS_COMPAT_AUTH_TOKEN* configuration variable.
1414
1415 - (:pr:`120`) :class:`.RoleMixin` now has a method :meth:`.get_permissions` which is called as part
1416 each request to add Permissions to the authenticated user. It checks if the RoleModel
1417 has a property ``permissions`` and assumes it is a comma separated string of permissions.
1418 If your model already has such a property this will likely fail. You need to override :meth:`.get_permissions`
1419 and simply return an emtpy set.
1420
1421 - (:issue:`121`) Changes the default (failure) behavior for views protected with @auth_required, @token_auth_required,
1422 or @http_auth_required. Before, a 401 was returned with some stock html. Now, Flask-Login.unauthorized() is
1423 called (the same as @login_required does) - which by default redirects to a login page/view. If you had provided your own
1424 `.Security.unauthorized_callback` there are no changes - that will still be called first. The old default
1425 behavior can be restored by setting *SECURITY_BACKWARDS_COMPAT_UNAUTHN* to True. Please see :ref:`responsetopic` for details.
1426
1427 - (:issue:`127`) Fix for LazyStrings in json error response. The fix for this has Flask-Security registering
1428 its own JsonEncoder on its blueprint. If you registered your own JsonEncoder for your app - it will no
1429 longer be called when serializing responses to Flask-Security endpoints. You can register your JsonEncoder
1430 on Flask-Security's blueprint by sending it as `json_encoder_cls` as part of initialization. Be aware that your
1431 JsonEncoder needs to handle LazyStrings (see speaklater).
1432
1433 - (:issue:`84`) Prior to this fix - anytime the decorator :func:`.anonymous_user_required` failed, it caused a redirect to
1434 the post_login_view. Now, if the caller wanted a JSON response, it will return a 400.
1435
1436 - (:issue:`156`) Faster Authentication Token introduced the following non-backwards compatible behavior change:
1437
1438 * Since the old Authentication Token algorithm used the (hashed) user's password, those tokens would be invalidated
1439 whenever the user changed their password. This is not likely to be what most users expect. Since the new
1440 Authentication Token algorithm doesn't refer to the user's password, changing the user's password won't invalidate
1441 outstanding Authentication Tokens. The method :meth:`.UserDatastore.set_uniquifier` can be used by an administrator
1442 to change a user's ``fs_uniquifier`` - but nothing the user themselves can do to invalidate their Authentication Tokens.
1443 Setting the *SECURITY_BACKWARDS_COMPAT_AUTH_TOKEN_INVALIDATE* configuration variable will cause the user's ``fs_uniquifier`` to
1444 be changed when they change their password, thus restoring prior behavior.
1445
1446
1447 New fast authentication token implementation
1448 ++++++++++++++++++++++++++++++++++++++++++++
1449 Current auth tokens are slow because they use the user's password (hashed) as a uniquifier (the
1450 user id isn't really enough since it might be reused). This requires checking the (hashed) password against
1451 what is in the token on EVERY request - however hashing is (on purpose) slow. So this can add almost a whole second
1452 to every request.
1453
1454 To solve this, a new attribute in the User model was added - ``fs_uniquifier``. If this is present in your
1455 User model, then it will be used instead of the password for ensuring the token corresponds to the correct user.
1456 This is very fast. If that attribute is NOT present - then the behavior falls back to the existing (slow) method.
1457
1458
1459 DB Migration
1460 ~~~~~~~~~~~~
1461
1462 To use the new UserModel mixins or to add the column ``user.fs_uniquifier`` to speed up token
1463 authentication, a schema AND data migration needs to happen. If you are using Alembic the schema migration is
1464 easy - but you need to add ``fs_uniquifier`` values to all your existing data. You can
1465 add code like this to your migrations::update method::
1466
1467 # be sure to MODIFY this line to make nullable=True:
1468 op.add_column('user', sa.Column('fs_uniquifier', sa.String(length=64), nullable=True))
1469
1470 # update existing rows with unique fs_uniquifier
1471 import uuid
1472 user_table = sa.Table('user', sa.MetaData(), sa.Column('id', sa.Integer, primary_key=True),
1473 sa.Column('fs_uniquifier', sa.String))
1474 conn = op.get_bind()
1475 for row in conn.execute(sa.select([user_table.c.id])):
1476 conn.execute(user_table.update().values(fs_uniquifier=uuid.uuid4().hex).where(user_table.c.id == row['id']))
1477
1478 # finally - set nullable to false
1479 op.alter_column('user', 'fs_uniquifier', nullable=False)
1480
1481 # for MySQL the previous line has to be replaced with...
1482 # op.alter_column('user', 'fs_uniquifier', existing_type=sa.String(length=64), nullable=False)
1483
1484
1485 Version 3.2.0
1486 -------------
1487
1488 Released June 26th 2019
1489
1490 - (:pr:`80`) Support caching of authentication token (eregnier `opr #839 <https://github.com/mattupstate/flask-security/pull/839>`_).
1491 This adds a new configuration variable *SECURITY_USE_VERIFY_PASSWORD_CACHE*
1492 which enables a cache (with configurable TTL) for authentication tokens.
1493 This is a big performance boost for those accessing Flask-Security via token
1494 as opposed to session.
1495 - (:pr:`81`) Support for JSON/Single-Page-Application. This completes support
1496 for non-form based access to Flask-Security. See PR for details. (jwag956)
1497 - (:pr:`79` Add POST logout to enhance JSON usage (jwag956).
1498 - (:pr:`73`) Fix get_user for various DBs (jwag956).
1499 This is a more complete fix than in opr #633.
1500 - (:pr:`78`, :pr:`103`) Add formal openapi API spec (jwag956).
1501 - (:pr:`86`, :pr:`94`, :pr:`98`, :pr:`101`, :pr:`104`) Add Two-factor authentication (opr #842) (baurt, jwag956).
1502 - (:issue:`108`) Fix form field label translations (jwag956)
1503 - (:issue:`115`) Fix form error message translations (upstream #801) (jwag956)
1504 - (:issue:`87`) Convert entire repo to Black (baurt)
1505
1506 Version 3.1.0
1507 -------------
1508
1509 Released never
1510
1511 - (:pr:`53`) Use Security.render_template in mails too (noirbizarre `opr #487 <https://github.com/mattupstate/flask-security/pull/487>`_)
1512 - (:pr:`56`) Optimize DB accesses by using an SQL JOIN when retrieving a user. (nfvs `opr #679 <https://github.com/mattupstate/flask-security/pull/679>`_)
1513 - (:pr:`57`) Add base template to security templates (grihabor `opr #697 <https://github.com/mattupstate/flask-security/pull/697>`_)
1514 - (:pr:`73`) datastore: get user by numeric identity attribute (jirikuncar `opr #633 <https://github.com/mattupstate/flask-security/pull/633>`_)
1515 - (:pr:`58`) bugfix: support application factory pattern (briancappello `opr #703 <https://github.com/mattupstate/flask-security/pull/703>`_)
1516 - (:pr:`60`) Make SECURITY_PASSWORD_SINGLE_HASH a list of scheme ignoring double hash (noirbizarre `opr #714 <https://github.com/mattupstate/flask-security/pull/714>`_)
1517 - (:pr:`61`) Allow custom login_manager to be passed in to Flask-Security (jaza `opr #717 <https://github.com/mattupstate/flask-security/pull/717>`_)
1518 - (:pr:`62`) Docs for OAauth2-based custom login manager (jaza `opr #727 <https://github.com/mattupstate/flask-security/pull/727>`_)
1519 - (:pr:`63`) core: make the User model check the password (mklassen `opr #779 <https://github.com/mattupstate/flask-security/pull/779>`_)
1520 - (:pr:`64`) Customizable send_mail (abulte `opr #730 <https://github.com/mattupstate/flask-security/pull/730>`_)
1521 - (:pr:`68`) core: fix default for UNAUTHORIZED_VIEW (jirijunkar `opr #726 <https://github.com/mattupstate/flask-security/pull/726>`_)
1522
1523 These should all be backwards compatible.
1524
1525 Possible compatibility issues:
1526
1527 - #487 - prior to this, render_template() was overridable for views, but not
1528 emails. If anyone actually relied on this behavior, this has changed.
1529 - #703 - get factory pattern working again. There was a very complex dance between
1530 Security() instantiation and init_app regarding kwargs. This has been rationalized (hopefully).
1531 - #679 - SqlAlchemy SQL improvement. It is possible you will get the following error::
1532
1533 Got exception during processing: <class 'sqlalchemy.exc.InvalidRequestError'> -
1534 'User.roles' does not support object population - eager loading cannot be applied.
1535
1536 This is likely solvable by removing ``lazy='dynamic'`` from your Role definition.
1537
1538
1539 Performance improvements:
1540
1541 - #679 - for sqlalchemy, for each request, there would be 2 DB accesses - now
1542 there is one.
1543
1544 Testing:
1545 For datastores operations, Sqlalchemy, peewee, pony were all tested against sqlite,
1546 postgres, and mysql real databases.
1547
1548
1549 Version 3.0.2
1550 -------------
1551
1552 Released April 30th 2019
1553
1554 - (opr #439) HTTP Auth respects SECURITY_USER_IDENTITY_ATTRIBUTES (pnpnpn)
1555 - (opr #660) csrf_enabled` deprecation fix (abulte)
1556 - (opr #671) Fix referrer loop in _get_unauthorized_view(). (nfvs)
1557 - (opr #675) Fix AttributeError in _request_loader (sbagan)
1558 - (opr #676) Fix timing attack on login form (cript0nauta)
1559 - (opr #683) Close db connection after running tests (reambus)
1560 - (opr #691) docs: add password salt to SQLAlchemy app example (KshitijKarthick)
1561 - (opr #692) utils: fix incorrect email sender type (switowski)
1562 - (opr #696) Fixed broken Click link (williamhatcher)
1563 - (opr #722) Fix password recovery confirmation on deleted user (kesara)
1564 - (opr #747) Update login_user.html (rickwest)
1565 - (opr #748) i18n: configurable the dirname domain (escudero)
1566 - (opr #835) adds relevant user to reset password form for validation purposes (fuhrysteve)
1567
1568 These are bug fixes and a couple very small additions.
1569 No change in behavior and no new functionality.
1570 'opr#' is the original pull request from https://github.com/mattupstate/flask-security
1571
1572 Version 3.0.1
1573 --------------
1574
1575 Released April 28th 2019
1576
1577 - Support 3.7 as part of CI
1578 - Rebrand to this forked repo
1579 - (#15) Build docs and translations as part of CI
1580 - (#17) Move to msgcheck from pytest-translations
1581 - (opr #669) Fix for Read the Docs (jirikuncar)
1582 - (opr #710) Spanish translation (maukoquiroga)
1583 - (opr #712) i18n: improvements of German translations (eseifert)
1584 - (opr #713) i18n: add Portuguese (Brazilian) translation (dinorox)
1585 - (opr #719) docs: fix anchor links and typos (kesara)
1586 - (opr #751) i18n: fix missing space (abulte)
1587 - (opr #762) docs: fixed proxy import (lsmith)
1588 - (opr #767) Update customizing.rst (allanice001)
1589 - (opr #776) i18n: add Portuguese (Portugal) translation (micael-grilo)
1590 - (opr #791) Fix documentation for mattupstate#781 (fmerges)
1591 - (opr #796) Chinese translations (Steinkuo)
1592 - (opr #808) Clarify that a commit is needed after login_user (christophertull)
1593 - (opr #823) Add Turkish translation (Admicos)
1594 - (opr #831) Catalan translation (miceno)
1595
1596 These are all documentation and i18n changes - NO code changes. All except the last 3 were accepted and reviewed by
1597 the original Flask-Security team.
1598 Thanks as always to all the contributors.
1599
1600 Version 3.0.0
1601 -------------
1602
1603 Released May 29th 2017
1604
1605 - Fixed a bug when user clicking confirmation link after confirmation
1606 and expiration causes confirmation email to resend. (see #556)
1607 - Added support for I18N.
1608 - Added options `SECURITY_EMAIL_PLAINTEXT` and `SECURITY_EMAIL_HTML`
1609 for sending respectively plaintext and HTML version of email.
1610 - Fixed validation when missing login information.
1611 - Fixed condition for token extraction from JSON body.
1612 - Better support for universal bdist wheel.
1613 - Added port of CLI using Click configurable using options
1614 `SECURITY_CLI_USERS_NAME` and `SECURITY_CLI_ROLES_NAME`.
1615 - Added new configuration option `SECURITY_DATETIME_FACTORY` which can
1616 be used to force default timezone for newly created datetimes.
1617 (see mattupstate/flask-security#466)
1618 - Better IP tracking if using Flask 0.12.
1619 - Renamed deprecated Flask-WFT base form class.
1620 - Added tests for custom forms configured using app config.
1621 - Added validation and tests for next argument in logout endpoint. (see #499)
1622 - Bumped minimal required versions of several packages.
1623 - Extended test matric on Travis CI for minimal and released package versions.
1624 - Added of .editorconfig and forced tests for code style.
1625 - Fixed a security bug when validating a confirmation token, also checks
1626 if the email that the token was created with matches the user's current email.
1627 - Replaced token loader with request loader.
1628 - Changed trackable behavior of `login_user` when IP can not be detected from a request from 'untrackable' to `None` value.
1629 - Use ProxyFix instead of inspecting X-Forwarded-For header.
1630 - Fix identical problem with app as with datastore.
1631 - Removed always-failing assertion.
1632 - Fixed failure of init_app to set self.datastore.
1633 - Changed to new style flask imports.
1634 - Added proper error code when returning JSON response.
1635 - Changed obsolete Required validator from WTForms to DataRequired. Bumped Flask-WTF to 0.13.
1636 - Fixed missing `SECURITY_SUBDOMAIN` in config docs.
1637 - Added cascade delete in PeeweeDatastore.
1638 - Added notes to docs about `SECURITY_USER_IDENTITY_ATTRIBUTES`.
1639 - Inspect value of `SECURITY_UNAUTHORIZED_VIEW`.
1640 - Send password reset instructions if an attempt has expired.
1641 - Added "Forgot password?" link to LoginForm description.
1642 - Upgraded passlib, and removed bcrypt version restriction.
1643 - Removed a duplicate line ('retype_password': 'Retype Password') in forms.py.
1644 - Various documentation improvement.
1645
1646 Version 1.7.5
1647 -------------
1648
1649 Released December 2nd 2015
1650
1651 - Added `SECURITY_TOKEN_MAX_AGE` configuration setting
1652 - Fixed calls to `SQLAlchemyUserDatastore.get_user(None)` (this now returns `False` instead of raising a `TypeError`
1653 - Fixed URL generation adding extra slashes in some cases (see GitHub #343)
1654 - Fixed handling of trackable IP addresses when the `X-Forwarded-For` header contains multiple values
1655 - Include WWW-Authenticate headers in `@auth_required` authentication checks
1656 - Fixed error when `check_token` function is used with a json list
1657 - Added support for custom `AnonymousUser` classes
1658 - Restricted `forgot_password` endpoint to anonymous users
1659 - Allowed unauthorized callback to be overridden
1660 - Fixed issue where passwords cannot be reset if currently set to `None`
1661 - Ensured that password reset tokens are invalidated after use
1662 - Updated `is_authenticated` and `is_active` functions to support Flask-Login changes
1663 - Various documentation improvements
1664
1665
1666 Version 1.7.4
1667 -------------
1668
1669 Released October 13th 2014
1670
1671 - Fixed a bug related to changing existing passwords from plaintext to hashed
1672 - Fixed a bug in form validation that did not enforce case insensitivity
1673 - Fixed a bug with validating redirects
1674
1675
1676 Version 1.7.3
1677 -------------
1678
1679 Released June 10th 2014
1680
1681 - Fixed a bug where redirection to `SECURITY_POST_LOGIN_VIEW` was not respected
1682 - Fixed string encoding in various places to be friendly to unicode
1683 - Now using `werkzeug.security.safe_str_cmp` to check tokens
1684 - Removed user information from JSON output on `/reset` responses
1685 - Added Python 3.4 support
1686
1687
1688 Version 1.7.2
1689 -------------
1690
1691 Released May 6th 2014
1692
1693 - Updated IP tracking to check for `X-Forwarded-For` header
1694 - Fixed a bug regarding the re-hashing of passwords with a new algorithm
1695 - Fixed a bug regarding the `password_changed` signal.
1696
1697
1698 Version 1.7.1
1699 -------------
1700
1701 Released January 14th 2014
1702
1703 - Fixed a bug where passwords would fail to verify when specifying a password hash algorithm
1704
1705
1706 Version 1.7.0
1707 -------------
1708
1709 Released January 10th 2014
1710
1711 - Python 3.3 support!
1712 - Dependency updates
1713 - Fixed a bug when `SECURITY_LOGIN_WITHOUT_CONFIRMATION = True` did not allow users to log in
1714 - Added `SECURITY_SEND_PASSWORD_RESET_NOTICE_EMAIL` configuration option to optionally send password reset notice emails
1715 - Add documentation for `@security.send_mail_task`
1716 - Move to `request.get_json` as `request.json` is now deprecated in Flask
1717 - Fixed a bug when using AJAX to change a user's password
1718 - Added documentation for select functions in the `flask_security.utils` module
1719 - Fixed a bug in `flask_security.forms.NextFormMixin`
1720 - Added `CHANGE_PASSWORD_TEMPLATE` configuration option to optionally specify a different change password template
1721 - Added the ability to specify addtional fields on the user model to be used for identifying the user via the `USER_IDENTITY_ATTRIBUTES` configuration option
1722 - An error is now shown if a user tries to change their password and the password is the same as before. The message can be customed with the `SECURITY_MSG_PASSWORD_IS_SAME` configuration option
1723 - Fixed a bug in `MongoEngineUserDatastore` where user model would not be updated when using the `add_role_to_user` method
1724 - Added `SECURITY_SEND_PASSWORD_CHANGE_EMAIL` configuration option to optionally disable password change email from being sent
1725 - Fixed a bug in the `find_or_create_role` method of the PeeWee datastore
1726 - Removed pypy tests
1727 - Fixed some tests
1728 - Include CHANGES and LICENSE in MANIFEST.in
1729 - A bit of documentation cleanup
1730 - A bit of code cleanup including removal of unnecessary utcnow call and simplification of get_max_age method
1731
1732
1733 Version 1.6.9
1734 -------------
1735
1736 Released August 20th 2013
1737
1738 - Fix bug in SQLAlchemy datastore's `get_user` function
1739 - Fix bug in PeeWee datastore's `remove_role_from_user` function
1740 - Fixed import error caused by new Flask-WTF release
1741
1742
1743 Version 1.6.8
1744 -------------
1745
1746 Released August 1st 2013
1747
1748 - Fixed bug with case sensitivity of email address during login
1749 - Code cleanup regarding token_callback
1750 - Ignore validation errors in find_user function for MongoEngineUserDatastore
1751
1752
1753 Version 1.6.7
1754 -------------
1755
1756 Released July 11th 2013
1757
1758 - Made password length form error message configurable
1759 - Fixed email confirmation bug that prevented logged in users from confirming their email
1760
1761
1762 Version 1.6.6
1763 -------------
1764
1765 Released June 28th 2013
1766
1767 - Fixed dependency versions
1768
1769
1770 Version 1.6.5
1771 -------------
1772
1773 Released June 20th 2013
1774
1775 - Fixed bug in `flask.ext.security.confirmable.generate_confirmation_link`
1776
1777
1778 Version 1.6.4
1779 -------------
1780
1781 Released June 18th 2013
1782
1783 - Added `SECURITY_DEFAULT_REMEMBER_ME` configuration value to unify behavior between endpoints
1784 - Fixed Flask-Login dependency problem
1785 - Added optional `next` parameter to registration endpoint, similar to that of login
1786
1787
1788 Version 1.6.3
1789 -------------
1790
1791 Released May 8th 2013
1792
1793 - Fixed bug in regards to imports with latest version of MongoEngine
1794
1795
1796 Version 1.6.2
1797 -------------
1798
1799 Released April 4th 2013
1800
1801 - Fixed bug with http basic auth
1802
1803
1804 Version 1.6.1
1805 -------------
1806
1807 Released April 3rd 2013
1808
1809 - Fixed bug with signals
1810
1811
1812 Version 1.6.0
1813 -------------
1814
1815 Released March 13th 2013
1816
1817 - Added Flask-Pewee support
1818 - Password hashing is now more flexible and can be changed to a different type at will
1819 - Flask-Login messages are configurable
1820 - AJAX requests must now send a CSRF token for security reasons
1821 - Form messages are now configurable
1822 - Forms can now be extended with more fields
1823 - Added change password endpoint
1824 - Added the user to the request context when successfully authenticated via http basic and token auth
1825 - The Flask-Security blueprint subdomain is now configurable
1826 - Redirects to other domains are now not allowed during requests that may redirect
1827 - Template paths can be configured
1828 - The welcome/register email can now optionally be sent to the user
1829 - Passwords can now contain non-latin characters
1830 - Fixed a bug when confirming an account but the account has been deleted
1831
1832
1833 Version 1.5.4
1834 -------------
1835
1836 Released January 6th 2013
1837
1838 - Fix bug in forms with `csrf_enabled` parameter not accounting attempts to login using JSON data
1839
1840
1841 Version 1.5.3
1842 -------------
1843
1844 Released December 23rd 2012
1845
1846 - Change dependency requirement
1847
1848 Version 1.5.2
1849 -------------
1850
1851 Released December 11th 2012
1852
1853 - Fix a small bug in `flask_security.utils.login_user` method
1854
1855 Version 1.5.1
1856 -------------
1857
1858 Released November 26th 2012
1859
1860 - Fixed bug with `next` form variable
1861 - Added better documentation regarding Flask-Mail configuration
1862 - Added ability to configure email subjects
1863
1864 Version 1.5.0
1865 -------------
1866
1867 Released October 11th 2012
1868
1869 - Major release. Upgrading from previous versions will require a bit of work to
1870 accommodate API changes. See documentation for a list of new features and for
1871 help on how to upgrade.
1872
1873 Version 1.2.3
1874 -------------
1875
1876 Released June 12th 2012
1877
1878 - Fixed a bug in the RoleMixin eq/ne functions
1879
1880 Version 1.2.2
1881 -------------
1882
1883 Released April 27th 2012
1884
1885 - Fixed bug where `roles_required` and `roles_accepted` did not pass the next
1886 argument to the login view
1887
1888 Version 1.2.1
1889 -------------
1890
1891 Released March 28th 2012
1892
1893 - Added optional user model mixin parameter for datastores
1894 - Added CreateRoleCommand to available Flask-Script commands
1895
1896 Version 1.2.0
1897 -------------
1898
1899 Released March 12th 2012
1900
1901 - Added configuration option `SECURITY_FLASH_MESSAGES` which can be set to a
1902 boolean value to specify if Flask-Security should flash messages or not.
1903
1904 Version 1.1.0
1905 -------------
1906
1907 Initial release