summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/framework/src/index.html
blob: 1a373392d3af5602681622a68da4b3de5d716061 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <!-- <link rel="stylesheet" href="./vendor.css" > -->
  <title>O D L UX</title>
</head>

<body>
  <div id="app"></div>
  <script type="text/javascript" src="./require.js"></script>
  <script type="text/javascript" src="./config.js"></script>
  <script>
    // run the application
    require(["run"], function (run) {
      run.runApplication();
    });
  </script>
</body>

</html>
class="c1"># ============LICENSE_END============================================ # # ECOMP is a trademark and service mark of AT&T Intellectual Property. from itsdangerous import URLSafeTimedSerializer from rest_framework_jwt.settings import api_settings from rest_framework_jwt.utils import jwt_decode_handler from engagementmanager.models import IceUserProfile from engagementmanager.utils.request_data_mgr import request_data_mgr from engagementmanager.service.logging_service import LoggingServiceFactory logger = LoggingServiceFactory.get_logger() def ice_jwt_decode_handler(token): decoded_dict = jwt_decode_handler(token) email = decoded_dict.get('email', None) user = IceUserProfile.objects.get(email=email) request_data_mgr.clear_old_request_data() request_data_mgr.set_user(user) return decoded_dict class JWTAuthentication(object): """ Simple token based authentication. Clients should authenticate by passing the token key in the "Authorization" HTTP header, prepended with the string "Token ". For example: Authorization: Token 401f7ac837da42b97f613d789819ff93537bee6a """ def create_token(self, user_data): jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER payload = jwt_payload_handler(user_data) token = jwt_encode_handler(payload) return token def create_reset_password_token(self, user_data): """ Create token for reset password flow. """ encryptor = URLSafeTimedSerializer(api_settings.JWT_SECRET_KEY) return encryptor.dumps(user_data.email, salt=api_settings.JWT_SECRET_KEY) def decode_reset_password_token(self, token): """ Decoded the token created at reset password flow and return what was encrypted. """ decryptor = URLSafeTimedSerializer(api_settings.JWT_SECRET_KEY) email = decryptor.loads( token, salt=api_settings.JWT_SECRET_KEY, max_age=3600 ) return email