Gerenios / AADInternals

AADInternals PowerShell module for administering Azure AD and Office 365
http://aadinternals.com/aadinternals
MIT License
1.2k stars 210 forks source link

Azure Government / national cloud support #59

Closed milesgratz closed 2 months ago

milesgratz commented 1 year ago

Would it be possible for the access token / bulk enrollment token functionality to not be hardcoded to the commercial tenants?

Current behavior will result in an error related to cross-cloud functionality: ConvertFrom-Json : Invalid JSON primitive: AADSTS90038.

Hardcoded Endpoints Azure Government (GCCH endpoints)
graph.microsoft.net graph.microsoft.us
urn:ms-drs:enterpriseregistration.windows.net urn:ms-drs:enterpriseregistration.microsoftonline.us

It does not appear possible to specify manually the right endpoints:

VERBOSE: ACCESS TOKEN HAS WRONG AUDIENCE: . Exptected: urn:ms-drs:enterpriseregistration.windows.net.
The audience of the access token () is wrong. Should be urn:ms-drs:enterpriseregistration.windows.net!

Reference:

NestoriSyynimaa commented 1 year ago

Let me see how I could implement this. Would you be interested to test this (I don't have access to government endpoints)?

yaurora commented 1 year ago

Would be nice also to support China cloud:

Azure China endpoints microsoftgraph.chinacloudapi.cn urn:ms-drs:enterpriseregistration.partner.microsoftonline.cn

wbrown0389 commented 7 months ago

Let me see how I could implement this. Would you be interested to test this (I don't have access to government endpoints)?

If you can spare some cycles on this, we would be happy to test. We are actively working on this for a GCCH customer.

benatsb commented 4 months ago

@NestoriSyynimaa , I can assit with testing in the GCCHigh/Azure Gov if you'd like.

jelliott7 commented 3 months ago

Going to do a PR soon that should partially address this issue.