Skip to content

JSB/JU 10, token duration ends in a year.#595

Merged
black-redoc merged 1 commit intoedunext/limonero.masterfrom
JSB/JU-10
Dec 13, 2021
Merged

JSB/JU 10, token duration ends in a year.#595
black-redoc merged 1 commit intoedunext/limonero.masterfrom
JSB/JU-10

Conversation

@black-redoc
Copy link
Contributor

@black-redoc black-redoc commented Dec 9, 2021

description:
This PR makes the token duration ends in a year.

commits during migration:

issue on JIRA

how to test:

In your terminal paste this curl script, if you have another tenant change these, then write yours

curl --location --request POST 'http://tenant-a.lms.limonero.edunext.link:8000/oauth2/access_token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=tenant-a-client-id' \
--data-urlencode 'client_secret=tenant-a-client-secret' \
--data-urlencode 'grant_type=client_credentials'

Then you have to obtain a result like this

{
  "access_token": "7wjnmhIHC3B67EvNDVD0xo68kwVQJy", 
  "expires_in": 31557600, 
  "token_type": "Bearer", 
  "scope": "read write email profile"
}

@black-redoc black-redoc changed the base branch from master to edunext/limonero.master December 9, 2021 18:54
date_field = Date()
StudentFieldOverride = apps.get_model('courseware', 'StudentFieldOverride')
log = logging.getLogger(__name__)
# log = logging.getLogger(__name__)
Copy link
Contributor

@mariajgrimaldi mariajgrimaldi Dec 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mariajgrimaldi this is removed yet!

user=override.student)
except Exception: # pylint: disable=broad-except
log.exception("migrating %d %r: %r", override.id, override.location, override.value)
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave this comment:

            # The following line is commented since these logs only add noise to output console
            # Thi migration only works with IDDE
            # log.exception("migrating %d %r: %r", override.id, override.location, override.value)

From: cb57dec

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaferMazu this is done!


import json
import logging
# import logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mariajgrimaldi this is done!

Making the oauth2 tokens with grant client_credentials live for one year

refactor: deleted unnecesary comments

refactor: replaced comments above of exception section

refactor: deleted unnecesary import comment
@black-redoc black-redoc merged commit faeef21 into edunext/limonero.master Dec 13, 2021
@johanseto johanseto changed the title JSB/JU 10 JSB/JU 10, token duration ends in a year. Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants