Welcome and thank you for your interest in contributing to Simple Auth! Before contributing to this project, please review this document for policies and procedures which will ease the contribution and review process for everyone. If you have questions, please raise your issue on github.
Follow the official documents to install the required softwares:
Build in Visual Studio directly, or use dotnet build
command under root folder.
- Set proper value for the configurations in
./src/TeamsFxSimpleAuth/appsettings.json
. Follow README for how to set the configurations. - Change solution configuration to
Debug
in Visual Studio. - Set
TeamsFxSimpleAuth
as start up project in Visual Studio. - Press F5 to start the project in debug mode.
You only need to take following steps once.
- Register your M365 subscription at https://developer.microsoft.com/en-us/microsoft-365. Record the username, password for your admin account, and tenant id for your M365 tenant.
- Create an AAD app registration named
teamsfx-integration-test-main-app
using admin account from step 1. Record the client id of this app. - Configure the AAD app registration created in step 2:
- Add redirect uri: https://localhost. The redirect uri does not need to be valid. The test framework will parse the AAD response from redirect uri.
- Generate client secret, record the generated secret.
- Configure following application permission and grant admin consent for them in Azure Portal:
- Application.ReadWrite.All
- Application.ReadWrite.OwnedBy
- Policy.Read.All
- Policy.ReadWrite.ApplicationConfiguration
- Create a test user account under M365 tenant. Remember to update password after first sign in.
- Update the integration test configuration
./src/TeamsFxSimpleAuth.Tests/appsettings.IntegrationTest.json
"OAUTH_TOKEN_ENDPOINT": "https://login.microsoftonline.com/<your-M365-tenant-id>/oauth2/v2.0/token", "IntegrationTestSettings": { "TenantId": "<your-M365-tenant-id>", "AdminClientId": "<your-main-app-client-id>", "AdminClientSecret": "<your-main-app-client-secret>", "AuthorizeUrl": "https://login.microsoftonline.com/<your-M365-tenant-id>/oauth2/v2.0/authorize", "ApiAppIdUri": "api://localhost", "RedirectUri": "https://localhost", "CodeVerifier": "CodeVerifier_for_SimpleAuth_Integration_test", "TestUsername": "<your-authorized-test-user-account>", "TestPassword": "<password-for-authorized-test-user-account>", "TestUsername2": "<your-another-authorized-test-user-account>", "TestPassword2": "<password-for-another-authorized-test-user-account>", "Scope": "access_as_user" }
- Install Google Chrome on your development machine.
- Install ChromeDriver on your development machine, make sure the major version is same with Google Chrome version installed on your development machine.
- Update the version of nuget package
Selenium.WebDriver.ChromeDriver
inTeamsFxSimpleAuth.Test
, make sure the major version is same with Google Chrome version installed on your development machine. Please do not commit this version change.
Right click TeamsFxSimpleAuth.Test
project in Visual Studio, and choose Run Tests
.
- Change solution configuration to
Debug
in Visual Studio. - Navigate to the test case source code you want to debug.
- Right click the test case and choose
Debug Test(s)
.
The project already enabled StyleCop. Please fix the style warnings before commit.
- Check out a new branch from "main".
- Add your features and commit to the new branch.
- Make sure your changes are covered by tests. Run test cases
- Ensure code style check has no warning or error. Style Guidelines
- Create a pull request to merge your changes to "main" branch.
- At least one approve from code owners is required.