Skip to content

Commit 15513b1

Browse files
Merge pull request #184 from CommunityToolkit/revert-183-add-sources-arg
Revert "Add optional Scopes parameter to BaseProvider"
2 parents 42f6b75 + bac18c5 commit 15513b1

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

CommunityToolkit.Authentication.Msal/MsalProvider.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ public override async Task SignOutAsync()
171171
}
172172

173173
/// <inheritdoc/>
174-
public override Task<string> GetTokenAsync(bool silentOnly = false, string[] scopes = null)
174+
public override Task<string> GetTokenAsync(bool silentOnly = false)
175175
{
176-
var withScopes = scopes ?? this.Scopes;
177-
return this.GetTokenWithScopesAsync(withScopes, silentOnly);
176+
return this.GetTokenWithScopesAsync(Scopes, silentOnly);
178177
}
179178

180179
/// <summary>

CommunityToolkit.Authentication.Uwp/WindowsProvider.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,16 @@ public override async Task SignOutAsync()
184184
}
185185

186186
/// <inheritdoc />
187-
public override async Task<string> GetTokenAsync(bool silentOnly = false, string[] scopes = null)
187+
public override async Task<string> GetTokenAsync(bool silentOnly = false)
188188
{
189189
await SemaphoreSlim.WaitAsync();
190190

191191
try
192192
{
193-
// use request specific scopes if not null, otherwise use class scopes
194-
var authenticationScopes = scopes ?? this._scopes;
193+
var scopes = _scopes;
195194

196195
// Attempt to authenticate silently.
197-
var authResult = await AuthenticateSilentAsync(authenticationScopes);
196+
var authResult = await AuthenticateSilentAsync(scopes);
198197

199198
// Authenticate with user interaction as appropriate.
200199
if (authResult?.ResponseStatus != WebTokenRequestStatus.Success)

CommunityToolkit.Authentication/BaseProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public BaseProvider()
5252
public abstract Task AuthenticateRequestAsync(HttpRequestMessage request);
5353

5454
/// <inheritdoc />
55-
public abstract Task<string> GetTokenAsync(bool silentOnly = false, string[] scopes = null);
55+
public abstract Task<string> GetTokenAsync(bool silentOnly = false);
5656

5757
/// <inheritdoc />
5858
public abstract Task SignInAsync();

CommunityToolkit.Authentication/IProvider.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ public interface IProvider
3939
/// Retrieve a token for the authenticated user.
4040
/// </summary>
4141
/// <param name="silentOnly">Determines if the acquisition should be done without prompts to the user.</param>
42-
/// <param name="scopes"> Optional parameter for setting scopes specific to this token request. </param>
4342
/// <returns>A token string for the authenticated user.</returns>
44-
Task<string> GetTokenAsync(bool silentOnly = false, string[] scopes = null);
43+
Task<string> GetTokenAsync(bool silentOnly = false);
4544

4645
/// <summary>
4746
/// Sign in the user.

CommunityToolkit.Authentication/MockProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public override async Task AuthenticateRequestAsync(HttpRequestMessage request)
5252
}
5353

5454
/// <inheritdoc/>
55-
public override Task<string> GetTokenAsync(bool silentOnly = false, string[] scopes = null)
55+
public override Task<string> GetTokenAsync(bool silentOnly = false)
5656
{
5757
return Task.FromResult("<mock-provider-token>");
5858
}

0 commit comments

Comments
 (0)