Skip to content

Commit 3fe6857

Browse files
committed
- changes order of parameters again to avoid offending kotlin
1 parent 4b25631 commit 3fe6857

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

samples/deviceCodeSample/src/main/java/deviceCodeFlowMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static void deviceCodeFlow() throws AuthenticationException {
3131
.challengeConsumer(challenge -> {System.out.println(challenge.getMessage());})
3232
.build();
3333

34-
final TokenCredentialAuthProvider tokenCredAuthProvider = new TokenCredentialAuthProvider(deviceCodeCred, SCOPES);
34+
final TokenCredentialAuthProvider tokenCredAuthProvider = new TokenCredentialAuthProvider(SCOPES, deviceCodeCred);
3535
final OkHttpClient httpClient = HttpClients.createDefault(tokenCredAuthProvider);
3636

3737
final Request request = new Request.Builder().url("https://graph.microsoft.com/v1.0/me/").build();

samples/interactiveBrowserSample/src/main/java/interactiveBrowserMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private static void interactiveBrowser() throws AuthenticationException{
2929
.port(8765)
3030
.build();
3131

32-
final TokenCredentialAuthProvider tokenCredentialAuthProvider = new TokenCredentialAuthProvider(interactiveBrowserCredential, SCOPES);
32+
final TokenCredentialAuthProvider tokenCredentialAuthProvider = new TokenCredentialAuthProvider(SCOPES, interactiveBrowserCredential);
3333
final OkHttpClient httpClient = HttpClients.createDefault(tokenCredentialAuthProvider);
3434

3535
final Request request = new Request.Builder().url("https://graph.microsoft.com/v1.0/me/").build();

src/main/java/com/microsoft/graph/authentication/TokenCredentialAuthProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class TokenCredentialAuthProvider implements IAuthenticationProvider<Requ
4040
* @param tokenCredential Credential object inheriting the TokenCredential interface used to instantiate the Auth Provider
4141
*/
4242
public TokenCredentialAuthProvider(@Nonnull final TokenCredential tokenCredential) {
43-
this(tokenCredential, Arrays.asList(new String[] {DEFAULT_GRAPH_SCOPE}));
43+
this(Arrays.asList(new String[] {DEFAULT_GRAPH_SCOPE}), tokenCredential);
4444
}
4545

4646
/**
@@ -49,8 +49,8 @@ public TokenCredentialAuthProvider(@Nonnull final TokenCredential tokenCredentia
4949
* @param tokenCredential Credential object inheriting the TokenCredential interface used to instantiate the Auth Provider
5050
* @param scopes Specified desired scopes of the Auth Provider
5151
*/
52-
public TokenCredentialAuthProvider(@Nonnull final TokenCredential tokenCredential, @Nonnull final List<String> scopes) {
53-
this(tokenCredential, scopes, Duration.ofMinutes(DEFAULT_TOKEN_TIMEOUT));
52+
public TokenCredentialAuthProvider(@Nonnull final List<String> scopes, @Nonnull final TokenCredential tokenCredential) {
53+
this(scopes, Duration.ofMinutes(DEFAULT_TOKEN_TIMEOUT), tokenCredential);
5454
}
5555

5656
/**
@@ -60,7 +60,7 @@ public TokenCredentialAuthProvider(@Nonnull final TokenCredential tokenCredentia
6060
* @param scopes Specified desired scopes of the Auth Provider
6161
* @param tokenObtentionTimeout Maximum time to wait for token obtention. Default 10 minutes. Use lower value on application with stable connectivity and no user interactions.
6262
*/
63-
public TokenCredentialAuthProvider(@Nonnull final TokenCredential tokenCredential, @Nonnull final List<String> scopes, @Nonnull final Duration tokenObtentionTimeout) {
63+
public TokenCredentialAuthProvider(@Nonnull final List<String> scopes, @Nonnull final Duration tokenObtentionTimeout, @Nonnull final TokenCredential tokenCredential) {
6464
if(tokenCredential == null) {
6565
throw new IllegalArgumentException("tokenCredential parameter cannot be null.");
6666
}

0 commit comments

Comments
 (0)