Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultAllowedHostsValidator does not exist #1850

Open
slowcar opened this issue Feb 26, 2024 · 2 comments
Open

DefaultAllowedHostsValidator does not exist #1850

slowcar opened this issue Feb 26, 2024 · 2 comments

Comments

@slowcar
Copy link

slowcar commented Feb 26, 2024

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

@Ndiritu
Copy link
Contributor

Ndiritu commented Feb 26, 2024

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?

@baywet
Copy link
Member

baywet commented Feb 26, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants