Adminutils on Sunbird

Introduction

Kong consumer tokens

Keycloak access token

  • These tokens are issued when a user logs in on the mobile or portal. Desktop app login does not follow this workflow as of now and is yet to be implemented. For more details on how this works, refer to this design doc

Deployment Files / Process

Token issue and signing process

Adminutils connections

  • Mobile / Desktop → Nginx → Kong → Adminutils - For the mobile / desktop register API kong consumer token and refresh token API (Desktop doesn’t yet invoke the refresh token endpoint)

  • Portal → Kong → Adminutils - For portal anonymous and loggedin kong consumer token and refresh token API

  • Adminutils → Kong → Learner Service - For fetching user roles

Rotating the keys

  • In order to rotate the keys, you can just run the key generate script to create a new set of keys and then commit to github and inject them to the pod.

  • The key generate script is located here - https://github.com/project-sunbird/sunbird-devops/blob/release-5.1.0/private_repo/ansible/inventory/dev/key-generate.sh

  • If old keys are replaced, all the user sessions will be invalidated and users will be logged out

  • Another way is to generate new set of keys by incrementing the key number. We can still retain the old keys for only verification purpose. We should configure adminutils to issue tokens using only the new set of keys. Eventually, all the tokens will be signed only using the new keys. After this point, the old keys can be removed even from verification flows. But this would be a manual activity and has not been tested. It can be automated if required.