Description
When an AAD authority uses a non-default port and its host is not in MSAL4J's trusted host set, instance discovery is redirected to the default trusted host. The authority's port is currently copied to that discovery endpoint.
For example, https://custom.example:8443/tenant produces an instance discovery endpoint at https://login.microsoftonline.com:8443/common/discovery/instance.
Expected behavior
Use the authority's port only when instance discovery targets the authority host itself. When discovery uses the default trusted host, use its default HTTPS port.
The original authority and its port should remain unchanged for authorization and token requests.
Description
When an AAD authority uses a non-default port and its host is not in MSAL4J's trusted host set, instance discovery is redirected to the default trusted host. The authority's port is currently copied to that discovery endpoint.
For example,
https://custom.example:8443/tenantproduces an instance discovery endpoint athttps://login.microsoftonline.com:8443/common/discovery/instance.Expected behavior
Use the authority's port only when instance discovery targets the authority host itself. When discovery uses the default trusted host, use its default HTTPS port.
The original authority and its port should remain unchanged for authorization and token requests.