docs: def authenticate(username, password):
      """
      Returns:
          a dict with:
              pk: the pk of the user
              token: dict containing all the data from the api
                  (access_token, refresh_token, expires_at etc.)
              user_data: dict containing user data such as
                  first_name, last_name etc.
          if the authentication succeeds
          Raises Unauthorized if the authentication fails
      """
      session = MoJOAuth2Session(
          client=LegacyApplicationClient(
              client_id=settings.API_CLIENT_ID
          )
      )
  
      token = session.fetch_token(
          token_url=get_request_token_url(),
          username=username,
          password=password,
          auth=HTTPBasicAuth(settings.API_CLIENT_ID, settings.API_CLIENT_SECRET),
          timeout=15,
          encoding='utf-8'
      )
  
      user_data = session.get('/users/{username}/'.format(username=username)).json()
  
      return {
          'pk': user_data.get('pk'),
          'token': token,
          'user_data': user_data
      }