Closed magajh closed 1 year ago
The unit tests were added cc @eduNEXT/dedalo
While making some tests, I realized the current site was being used to create the signup source for the new user, so I added the helper function get_or_create_site_from_oauth_app_uris to use the site sent in the redirect_uris field instead as the site for the signup source
Description
In this PR we add a new endpoint in the support API that creates a new Oauth Application in edxapp
Request example
More details on the implementation
In order to create a valid Application, the method has to perform multiple operations:
codename
field from the Django permissions that the application owner should have.Any of the Application model fields can be sent in the request body for the creation of the application (with the exception of the
create
andupdate
DateTime fields, who are marked in the serializer as read-only), but it works when only sending the basic information such asThe
client_id
andclient_secret
credentials will be automatically generatedWhy is this feature necessary?
The Xman service makes requests to multiple APIs from eox-core and eox-tenant and these endpoints normally use a Bearer Token authentication schema. We need to be able to programmatically generate an Oauth Application in edxapp from the Xman service, so the users in Control Center can successfully authenticate to the APIs via Xman and perform operations on their remote Site in edxapp.
Testing instructions
You can test this by making the following requests to the eox-core API
After making the request and obtaining a successful response, make sure you check that:
Checklist for Merge