@@ -156,16 +156,6 @@ protected override async Task<CredentialsRefreshState> GenerateNewCredentialsAsy
156
156
157
157
private void ValidateCredentialsInputs ( )
158
158
{
159
- if ( string . IsNullOrEmpty ( Options . ClientName ) )
160
- {
161
- throw new ArgumentNullException ( $ "Options property cannot be empty: { nameof ( Options . ClientName ) } ") ;
162
- }
163
-
164
- if ( Options . SsoVerificationCallback == null )
165
- {
166
- throw new ArgumentNullException ( $ "Options property cannot be empty: { nameof ( Options . SsoVerificationCallback ) } ") ;
167
- }
168
-
169
159
// Get the name of any empty properties
170
160
var emptyPropertyNames = new Dictionary < string , string >
171
161
{
@@ -236,6 +226,16 @@ private ImmutableCredentials GetSsoCredentials(ICoreAmazonSSOOIDC oidc, ICoreAma
236
226
// Get and cache a SSO token if necessary
237
227
if ( string . IsNullOrWhiteSpace ( token ) )
238
228
{
229
+ if ( string . IsNullOrEmpty ( Options . ClientName ) )
230
+ {
231
+ throw new ArgumentNullException ( $ "Options property cannot be empty: { nameof ( Options . ClientName ) } ") ;
232
+ }
233
+
234
+ if ( Options . SsoVerificationCallback == null )
235
+ {
236
+ throw new ArgumentNullException ( $ "Options property cannot be empty: { nameof ( Options . SsoVerificationCallback ) } ") ;
237
+ }
238
+
239
239
var response = oidc . GetSsoToken ( new GetSsoTokenRequest ( )
240
240
{
241
241
ClientName = GetSsoClientName ( ) ,
@@ -275,6 +275,16 @@ private async Task<ImmutableCredentials> GetSsoCredentialsAsync(ICoreAmazonSSOOI
275
275
// Get and cache a SSO token if necessary
276
276
if ( string . IsNullOrWhiteSpace ( token ) )
277
277
{
278
+ if ( string . IsNullOrEmpty ( Options . ClientName ) )
279
+ {
280
+ throw new ArgumentNullException ( $ "Options property cannot be empty: { nameof ( Options . ClientName ) } ") ;
281
+ }
282
+
283
+ if ( Options . SsoVerificationCallback == null )
284
+ {
285
+ throw new ArgumentNullException ( $ "Options property cannot be empty: { nameof ( Options . SsoVerificationCallback ) } ") ;
286
+ }
287
+
278
288
var response = await oidc . GetSsoTokenAsync ( new GetSsoTokenRequest ( )
279
289
{
280
290
ClientName = GetSsoClientName ( ) ,
0 commit comments