![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Debian
apt install python3-dev libldap2-dev libsasl2-dev
Centos
yum install python3-devel openldap-devel.x86_64 libgsasl-devel.x86_64
Alpine
apk add musl-dev openldap-dev gcc libgsasl-dev
pip install Flask-LDAPAuth
App configs
NAME | Default |
---|---|
LDAP_URL | None |
LDAP_ROOTDN | None |
LDAP_USERDN | None |
LDAP_GROUP | False |
LDAP_START_TLS | True |
LDAP_USER_FILTER | 'cn' |
LDAP_TIMEOUT | 10 |
SECRET_KEY | None |
LDAP_TOKEN_EXPIRE | 8 |
from flask import Flask, jsonify, make_response
from flask_ldapauth import LDAPAuth
app = Flask(__name__)
app.config['LDAP_URL'] = "ldap://localhost:389"
app.config['LDAP_ROOTDN'] = "dc=localhost"
app.config['LDAP_USERDN'] = "ou=People,dc=localhost"
auth = LDAPAuth(app)
@app.route('/login')
def index():
user = auth.connect(username='nmacias',
password='password')
if user is False:
return jsonify({'mesg': 'invalid username or password'}), 401
return jsonify({'mesg': 'login'})
def run():
app.config['DEBUG'] = True
app.config['ENV'] = 'development'
app.run()
def main():
run()
if __name__ == '__main__':
main()
from flask import Flask, jsonify, make_response
from flask_ldapauth import LDAPAuth
app = Flask(__name__)
app.config['LDAP_URL'] = "ldap://localhost:389"
app.config['LDAP_ROOTDN'] = "dc=localhost"
app.config['LDAP_USERDN'] = "ou=People,dc=localhost"
app.config['LDAP_GROUP'] = "admins"
app.config['SECRET_KEY'] = 'supersecretkey'
auth = LDAPAuth(app)
@app.route('/protected', methods=['GET', 'POST'])
@auth.protected(data=True)
def propected(data):
return jsonify({'mesg': 'Top secret', 'name': data['name']})
@app.route('/login')
def login():
user = auth.connect(username='nmacias',
password='password', return_user=True)
if user is False:
return jsonify({'mesg': 'invalid username or password'}), 401
token = auth.token.create(payload=user)
response = make_response(jsonify({'token': token}))
response.set_cookie('token', value=token, httponly=True)
return response
@app.route('/logout')
def logout():
response = make_response(jsonify({}))
response.set_cookie('token', expires=0)
return response
@app.route('/validate/<token>')
def validate(token):
token_validate = auth.token.validate(token=token)
if token_validate is False:
return jsonify({'mesg': 'Invalid token'}), 401
return jsonify({})
def run():
app.config['DEBUG'] = True
app.config['ENV'] = 'development'
app.run()
def main():
run()
if __name__ == '__main__':
main()
FAQs
List url link, script tags, reponse headers
We found that flask-ldapauth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.