Hi Awwab Asif ,
It looks like you're encountering an issue with insufficient privileges when trying to create a domain federation configuration using Microsoft Graph. Let's go through the steps to ensure everything is set up correctly and troubleshoot the issue.
Steps to Set Up SSO Between Microsoft 365 and Google
1. Configure Google as the Identity Provider
- Create a Google Application:
- Go to the Google Developers Console.
- Create a new project and configure the OAuth consent screen.
- Create OAuth credentials and note down the Client ID and Client Secret.
2. Set Up Microsoft as the Service Provider
- Configure SAML in Microsoft:
- In the Microsoft Entra admin center, navigate to Identity > External Identities > All identity providers.
- Select Google and configure it by entering the necessary details such as the Client ID and Client Secret obtained from Google.
3. PowerShell Script for Domain Federation
- Install Microsoft Graph PowerShell Module:
Install-Module Microsoft.Graph -Scope CurrentUser
- Connect to Microsoft Graph:
Connect-MgGraph -Scopes "Domain.ReadWrite.All"
- Create Domain Federation Configuration:
$domain = "yourdomain.com" $googleMetadataUrl = "https://accounts.google.com/.well-known/openid-configuration" New-MgDomainFederationConfiguration -DomainName $domain -MetadataUrl $googleMetadataUrl -IssuerUri "https://accounts.google.com"
Troubleshooting the Issue
The error message indicates insufficient privileges. Ensure that the account you're using has the necessary permissions to create domain federation configurations. You need to have the Domain.ReadWrite.All permission.
2. Update Microsoft Graph PowerShell Module
Make sure you are using the latest version of the Microsoft Graph PowerShell module. You can update it using:
Update-Module Microsoft.Graph
3. Verify Configuration
Double-check the configuration details, such as the Client ID, Client Secret, and metadata URL, to ensure they are correct.
4. Debugging
Use the -Debug
parameter to get more detailed information about the error:
New-MgDomainFederationConfiguration -DomainName $domain -MetadataUrl $googleMetadataUrl -IssuerUri "https://accounts.google.com" -Debug
References
- Add Google as an Identity Provider - Microsoft Entra External ID
- Configure Federation Between Google Workspace and Microsoft Entra ID
- Troubleshooting Common Errors in Microsoft Graph PowerShell
I hope these steps help you resolve the issue. If you need further assistance, feel free to ask. Good luck with your setup!
Best regards,
Jonathan
Your feedback is very important to us! If this answer resolved your query, please click 'YES'. This helps us continuously improve the quality and relevance of our solutions. Thank you for your cooperation!