diff --git a/main.py b/main.py index 89c08ef..f9653a2 100644 --- a/main.py +++ b/main.py @@ -13,6 +13,8 @@ import back_openstack as openstack from flask_cors import CORS import requests +from cas import CASClient + ################ @@ -26,6 +28,10 @@ app.config['TOKEN_SECRET_KEY'] = 'your_token_secret_key' app.config['SESSION_COOKIE_DOMAIN'] = 'insa-cvl.com' +cas_server_url = "https://cas.insa-cvl.fr/cas" +service_url = "https://api.insa-cvl.com" +cas = CASClient(cas_server_url, service_url) + db = SQLAlchemy(app) login_manager = LoginManager(app) #login_manager.login_view = 'login' @@ -134,6 +140,9 @@ def logincas(): ticket_id = request.args.get('ticket') # data = request.get_json() print(ticket_id) + # Get user information + user_info = cas.get_user() + print("User Info:", user_info) # print(data) return jsonify({'message': 'Login successful'+ticket_id}), 200