Skip to content

Commit fdd899b

Browse files
authored
Merge pull request #2092 from microsoftgraph/docs/host-validator-upgrade
docs: fixes the custom authentication provider example in upgrade documentation
2 parents e1f48d3 + 6f5487b commit fdd899b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/upgrade-to-v6.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ public class CustomTokenProvider implements AccessTokenProvider {
8383
return token;
8484
}
8585

86-
@Override
86+
// Make sure to have the right set of hosts
87+
private final AllowedHostsValidator validator = new AllowedHostsValidator("graph.microsoft.com");
88+
@Override
8789
public AllowedHostsValidator getAllowedHostsValidator() {
8890
// Handle allowed hosts validation logic here
89-
return new DefaultAllowedHostsValidator();
91+
return validator;
9092
}
9193
```
9294
Then instantiate the GraphServiceClient as follows:

0 commit comments

Comments
 (0)