msgraph-sdk-java
msgraph-sdk-java copied to clipboard
DefaultAllowedHostsValidator does not exist
The upgrade guide https://github.com/microsoftgraph/msgraph-sdk-java/blob/dev/docs/upgrade-to-v6.md#authentication suggests to use DefaultAllowedHostsValidator, but this class cannot be found in the SDK.
As a workaround i used the set from AzureIdentityAccessTokenProvider
Thanks for reporting this @slowcar. This was a typo. Initializing an AllowedHostsValidator using the set of Graph hosts in AzureIdentityAccessTokenProvider is perfect.
@baywet I'm thinking adding a GraphAllowedHostsValidator would be useful for devs implementing custom token providers for Graph?
I think it's a good idea to maximize reusability. However, rather than introducing a derived type, I'd just provide a static method that returns an array/set (whatever matches the API in the language) with the default values. In the case of Java, it'd only be a matter of moving this to a dedicated public static method. Do you want to start coordinating things by creating issues in the core repos for all languages?
I just ran into the same problem, please don't forget about this issue. Thanks in advance!
@mkomko thanks for the nudge here. Authored #2092