-
Notifications
You must be signed in to change notification settings - Fork 102
Integrate Hydra Lab test center with Microsoft AAD authentication service
Nathan Bu edited this page Feb 17, 2023
·
2 revisions
General Guideline for Spring Boot app auth integration: - Secure a Java web app using the Spring Boot Starter for Azure Active Directory.
- Add Microsoft authentication before accessing Hydra Lab Pages from the browser.
- Redirect to the original page before authentication.
- Register an application and input redirect url like Web - http://localhost:9886/api/auth, this url will be used later
- Generate client secret in Certificates & secrets, the secret will be used later
- Config permission in API permissions, the permission Microsoft Graph--User.Read is needed
- Take com.microsoft.devices.network.center.interceptor.BaseInterceptor.java as a reference
- Add the redirect url in Step1 to accessing whitelist
- Verify user info by checking the request session
- Return response that redirect to Microsoft login page directly if access unauthorized(https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize?client_id={clientId}&response_type=code&redirect_uri={redirectUri}&response_mode=query&scope=https://graph.microsoft.com/User.Read&state={state})
- tenant: get it from the application page in Azure: Application - Overview - Directory (tenant) ID
- clientId: get it from the application page in Azure: Application - Overview - Application (client) ID
- redirectUri: redirect url set in Step1
- state: This value will be sent back to Hydra Lab later. Can input the original url user first requested to.
- If login success, Microsoft OAuth platform will send a redirect response to the browser which will request the redirect url in Step1
- The request will contain two parameters code and state
- code: Generated by Microsoft OAuth platform. Will become invalid after first using.
- state: The value inputted in Step2
- Take com.microsoft.devices.network.center.controller.AuthController.java as a reference, param code is needed
- Request accesskey by invoke API https://login.microsoftonline.com/common/oauth2/v2.0/token, the parameters are
- client_id: Application - Overview - Application (client) ID
- code: code
- redirect_uri: redirect url set in Step1
- grant_type: authorization_code
- client_secret: generated in Step1
- Get original url from request by param state in Step3
- Put user info in session
- Return response that redirect to the original url.
- This is why config permission in Step1
- We can get user info by Graph API
- Some api permission need Admin approve
Introduction:
User manual:
- Deploy Center Docker Container
- Deploy Agent Docker Container
- Test agent setup
- One-Line-Installer Agent Setup
- [DEPRECATED]Deploy a test agent service
- Trigger a test task run in the Hydra Lab test service
- Create an Appium UI Test Automation Project
- Create test build and run XCTest
- Test Task Customization
- FAQ
Developer guideline:
- Start Services with Default Configuration
- Dev Environment Setup
- Technical Design
- Integrate Hydra Lab test center with Microsoft AAD authentication service
- Upgrade the test agent service from center service
News: