Hi @Katya Fedorova ,
Thanks for reaching out.
You can use Microsoft Graph API for test automation purposes without a redirect URL. However, you will need to use the client credentials flow instead of the authorization code flow.
The client credentials flow allows your test framework to authenticate directly with Azure AD and obtain an access token without user interaction. This flow is typically used for server-to-server authentication scenarios, but it can also be used for test automation purposes.
To use the client credentials flow, you will need to register your test framework as an Azure AD application and grant it the necessary application permissions rather than delegated permissions to access the Microsoft Graph API**.**
You can use the client ID and client secret of your Azure AD application to authenticate and obtain an access token.
Reference - https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow
Hope this will help.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.