stable

Clone or download

Read-only

Save scopes requested for each authorization

For now this information is stored in the database and not yet used. This information will be used to create access token with the requested scopes instead of always issuing an access token with the scope 'demo'. To test: 1. In the project admin create an OAuth2 app (note the ID and the given secret) 2. Access the authorize page at the URL https://tuleap.example.com/oauth2/authorize?client_id=<client_d>&scope=demo&response_type=code&redirect_uri=<redirect_uri> 3. Accept the requested authorization 4. The information should be stored in the plugin_oauth2_authorization_code_scope tables This is part of story #14542: have OAuth2 flow Change-Id: Ie7fc73fd7457736f9f0747d02938b641a45c5c98

Modified Files

Name
M plugins/oauth2_server/db/install.sql +6 −0 Go to diff View file
A plugins/oauth2_server/db/mysql/2020/202003171530_create_authorization_code_scope_table.php +46 −0 Go to diff View file
M plugins/oauth2_server/db/uninstall.sql +1 −0 Go to diff View file
M plugins/oauth2_server/include/AuthorizationServer/AuthorizationCodeResponseFactory.php +8 −1 Go to diff View file
M plugins/oauth2_server/include/AuthorizationServer/AuthorizationEndpointGetController.php +2 −2 Go to diff View file
M plugins/oauth2_server/include/AuthorizationServer/AuthorizationEndpointPostController.php +19 −3 Go to diff View file
M plugins/oauth2_server/include/AuthorizationServer/ScopeExtractor.php +3 −1 Go to diff View file
M plugins/oauth2_server/include/Grant/AuthorizationCode/OAuth2AuthorizationCodeCreator.php +38 −11 Go to diff View file
M plugins/oauth2_server/include/Grant/AuthorizationCode/OAuth2AuthorizationCodeDAO.php +2 −1 Go to diff View file
A plugins/oauth2_server/include/Grant/AuthorizationCode/Scope/OAuth2AuthorizationCodeScopeDAO.php +39 −0 Go to diff View file
A plugins/oauth2_server/include/Grant/AuthorizationCode/Scope/OAuth2AuthorizationCodeScopeSaver.php +53 −0 Go to diff View file
M plugins/oauth2_server/include/User/AuthorizationComparator.php +6 −1 Go to diff View file
M plugins/oauth2_server/include/oauth2_serverPlugin.php +17 −12 Go to diff View file
M plugins/oauth2_server/phpunit/AuthorizationServer/AuthorizationCodeResponseFactoryTest.php +3 −0 Go to diff View file
M plugins/oauth2_server/phpunit/AuthorizationServer/AuthorizationEndpointPostControllerTest.php +27 −0 Go to diff View file
M plugins/oauth2_server/phpunit/Grant/AuthorizationCode/OAuth2AuthorizationCodeCreatorTest.php +18 −2 Go to diff View file
A plugins/oauth2_server/phpunit/Grant/AuthorizationCode/Scope/OAuth2AuthorizationCodeScopeSaverTest.php +65 −0 Go to diff View file
M plugins/oauth2_server/phpunit/User/AuthorizationComparatorTest.php +1 −1 Go to diff View file
M src/common/Authentication/Scope/AuthenticationScopeBuilder.php +4 −0 Go to diff View file
M src/common/Authentication/Scope/AuthenticationScopeBuilderFromClassNames.php +3 −0 Go to diff View file